diff --git a/src/background/main.ts b/src/background/main.ts index 52db4c1..cefa1d5 100644 --- a/src/background/main.ts +++ b/src/background/main.ts @@ -125,12 +125,12 @@ async function uploadPost(data: PostUploadCommandData) { } } - if (browser.notifications) { + if (data.sendNotifications && browser.notifications) { const createdPostUrl = getUrl(data.selectedSite.domain, "post", createdPost.id.toString()); browser.notifications.create(createdPostUrl, { type: "basic", iconUrl: browser.runtime.getURL("assets/icon-128.png"), - title: "SzuruChrome", + title: data.selectedSite.domain, message: `Uploaded ${data.post.contentUrl}`, }); } diff --git a/src/models/index.ts b/src/models/index.ts index cb3ecdd..6d086fe 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -148,6 +148,7 @@ export class PostUploadCommandData { constructor( public readonly post: ScrapedPostDetails, public readonly selectedSite: SzuruSiteConfig, + public readonly sendNotifications: boolean, ) { } } diff --git a/src/options/App.vue b/src/options/App.vue index 3db145e..6e9acac 100644 --- a/src/options/App.vue +++ b/src/options/App.vue @@ -150,6 +150,17 @@ wnd.szc_set_config_version = (v = 0) => (cfg.value.version = v);
++ This will send a browser notification after a successful upload. Clicking the notification will open + the uploaded post in a new tab. +
+