Skip to content
This repository was archived by the owner on Aug 27, 2025. It is now read-only.

Commit e90c529

Browse files
committed
feat: auto load old tweets sync button
1 parent 1c67c3e commit e90c529

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

src/content-script/hooks/twitter.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ class TwitterHook {
2828
this.mountSyncToggleApp(el);
2929
},
3030
},
31+
{
32+
selector: '[data-testid="tweet"]',
33+
callback: async (el) => {
34+
this.mountSyncOldTweets();
35+
},
36+
},
3137
];
3238

3339
let startPromise: Promise<NoteInput> | undefined;
@@ -93,15 +99,15 @@ class TwitterHook {
9399
this.main.xlog('error', 'Failed to add account change event listener.', e);
94100
}
95101

96-
// Listen on route change Event
97-
try {
98-
this.main.xlog('info', 'Adding route change event listener.');
99-
window.removeEventListener('locationchange', () => this.mountSyncOldTweets()); // Remove old (if any)
100-
window.addEventListener('locationchange', () => this.mountSyncOldTweets()); // Add new
101-
} catch (e) {
102-
this.main.xlog('error', 'Failed to add route change event listener.', e);
103-
}
104-
this.mountSyncOldTweets(); // Init Run
102+
// // Listen on route change Event
103+
// try {
104+
// this.main.xlog('info', 'Adding route change event listener.');
105+
// window.removeEventListener('locationchange', () => this.mountSyncOldTweets()); // Remove old (if any)
106+
// window.addEventListener('locationchange', () => this.mountSyncOldTweets()); // Add new
107+
// } catch (e) {
108+
// this.main.xlog('error', 'Failed to add route change event listener.', e);
109+
// }
110+
// this.mountSyncOldTweets(); // Init Run
105111
}
106112

107113
private async sync(note: NoteInput, attachmentUrls?: string[]) {

0 commit comments

Comments
 (0)