mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: add more escape chars for multi file auth state
This commit is contained in:
@@ -44,14 +44,7 @@ export const useMultiFileAuthState = async(folder: string): Promise<{ state: Aut
|
|||||||
await mkdir(folder, { recursive: true })
|
await mkdir(folder, { recursive: true })
|
||||||
}
|
}
|
||||||
|
|
||||||
const fixFileName = (file) =>{
|
const fixFileName = (file?: string) => file?.replace(/\//g, '__')?.replace(/:/g, '-')
|
||||||
if(file){
|
|
||||||
return file.replace(/:/g, '-');
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return file
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const creds: AuthenticationCreds = await readData('creds.json') || initAuthCreds()
|
const creds: AuthenticationCreds = await readData('creds.json') || initAuthCreds()
|
||||||
|
|
||||||
@@ -65,7 +58,7 @@ export const useMultiFileAuthState = async(folder: string): Promise<{ state: Aut
|
|||||||
ids.map(
|
ids.map(
|
||||||
async id => {
|
async id => {
|
||||||
let value = await readData(`${type}-${id}.json`)
|
let value = await readData(`${type}-${id}.json`)
|
||||||
if(type === 'app-state-sync-key') {
|
if(type === 'app-state-sync-key' && value) {
|
||||||
value = proto.AppStateSyncKeyData.fromObject(value)
|
value = proto.AppStateSyncKeyData.fromObject(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user