Skip to content

Commit d985903

Browse files
committed
chore: Fixes of previous commits
1 parent 75914f2 commit d985903

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/auth/Auth.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ export class Auth extends Emittery<AuthEventTypes> {
3838
}
3939

4040
async initialize() {
41-
// Conn.on('change:ref', async () => {
42-
// const authCode = await this.getAuthCode().catch(() => null);
43-
// if (authCode) {
44-
// this.emit('change', authCode);
45-
// }
46-
// });
41+
Conn.on('change:ref', async () => {
42+
const authCode = await this.getAuthCode().catch(() => null);
43+
if (authCode) {
44+
this.emit('change', authCode);
45+
}
46+
});
4747

4848
State.on('change:state', async () => {
4949
const isIdle = this.isIdle();
@@ -52,8 +52,6 @@ export class Auth extends Emittery<AuthEventTypes> {
5252
}
5353
});
5454

55-
State.on('all', console.log);
56-
5755
Cmd.on('logout', () => this.emit('logout'));
5856
}
5957

src/tools/extractWhatsappSource.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ async function start() {
5353

5454
let content = body.toString('utf8');
5555

56-
content = content.replace(/\B!1\b/g, 'false');
57-
content = content.replace(/\B!0\b/g, 'true');
56+
content = content.replace(/([ ,:;=>(){}[\]|&])!1\b/g, '$1false');
57+
content = content.replace(/([ ,:;=>(){}[\]|&])!0\b/g, '$1true');
58+
content = content.replace(/\b(return|case)\s*!1\b/g, '$1 false');
59+
content = content.replace(/\b(return|case)\s*!0\b/g, '$1 true');
5860
content = content.replace(/\bvoid 0\b/g, 'undefined');
5961

6062
fs.writeFileSync(filePath, content, { encoding: 'utf8' });

0 commit comments

Comments
 (0)