Skip to content

Commit e1edc59

Browse files
committed
add a push complete notificatin
1 parent 1d98011 commit e1edc59

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/main/reactors/upload/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Conversation } from "@itchio/butlerd";
22
import { actions } from "common/actions";
33
import * as messages from "common/butlerd/messages";
44
import { hookLogging } from "common/butlerd/utils";
5+
import { t } from "common/format/t";
56
import { MAX_RECENT_PUSH_FOLDERS } from "common/reducers/preferences";
67
import { isCancelled, RecentPushFolder } from "common/types";
78
import { Watcher } from "common/util/watcher";
@@ -198,4 +199,18 @@ export default function (watcher: Watcher) {
198199
pendingPreviewCancels.add(id);
199200
}
200201
});
202+
203+
watcher.on(actions.pushDone, async (store, action) => {
204+
const { jobId, channel } = action.payload;
205+
const job = store.getState().upload.jobs[jobId];
206+
if (!job) return;
207+
const { i18n } = store.getState();
208+
const title = job.gameTitle ?? job.target;
209+
store.dispatch(
210+
actions.notify({
211+
body: t(i18n, ["notification.push_processing", { title, channel }]),
212+
onClick: actions.navigate({ wind: "root", url: "itch://upload" }),
213+
})
214+
);
215+
});
201216
}

src/static/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@
239239
"notification.download_updated": "{{title}} was updated!",
240240
"notification.download_reverted": "{{title}} was switched to {{version}}!",
241241
"notification.download_healed": "{{title}} verified and repaired!",
242+
"notification.push_processing":
243+
"{{title}}: {{channel}} pushed, server is processing the build",
242244
"onboarding.caved.prealpha_reminder": "Keep in mind this is a pre-alpha",
243245
"onboarding.caved.title_pick": "Take your pick",
244246
"onboarding.caved.troubleshoot_advice":

0 commit comments

Comments
 (0)