@@ -13,6 +13,7 @@ import duration from "dayjs/plugin/duration"
1313import localizedFormat from "dayjs/plugin/localizedFormat"
1414import relativeTime from "dayjs/plugin/relativeTime"
1515import { enableMapSet } from "immer"
16+ import { createElement } from "react"
1617import { toast } from "sonner"
1718
1819import { subscribeNetworkStatus } from "../atoms/network"
@@ -27,6 +28,7 @@ import {
2728 setHydrated ,
2829} from "./hydrate"
2930import { initPostHog } from "./posthog"
31+ import { pushAfterReadyCallback } from "./queue"
3032import { initSentry } from "./sentry"
3133
3234const cleanup = subscribeShouldUseIndexedDB ( ( value ) => {
@@ -64,7 +66,31 @@ export const initializeApp = async () => {
6466
6567 if ( lastVersion && lastVersion !== APP_VERSION ) {
6668 appLog ( `Upgrade from ${ lastVersion } to ${ APP_VERSION } ` )
67- // TODO
69+
70+ pushAfterReadyCallback ( ( ) => {
71+ setTimeout ( ( ) => {
72+ toast . success (
73+ // `App is upgraded to ${APP_VERSION}, enjoy the new features! 🎉`,
74+ createElement ( "div" , {
75+ children : [
76+ "App is upgraded to " ,
77+ createElement (
78+ "a" ,
79+ {
80+ href : `${ repository . url } /releases/tag/${ APP_VERSION } ` ,
81+ target : "_blank" ,
82+ className : "underline" ,
83+ } ,
84+ createElement ( "strong" , {
85+ children : APP_VERSION ,
86+ } ) ,
87+ ) ,
88+ ", enjoy the new features! 🎉" ,
89+ ] ,
90+ } ) ,
91+ )
92+ } , 1000 )
93+ } )
6894 }
6995 localStorage . setItem ( appVersionKey , APP_VERSION )
7096
0 commit comments