@@ -19,7 +19,7 @@ const notifyLocalStorageKey = 'notify_new_version';
19
19
* changelogPage: 'https://example.com/changelog'
20
20
* });
21
21
*/
22
- export function serviceWorkerNotifySnackbar ( options : { lastNotifyVersion : string ; changelogPage ?: string } ) : void {
22
+ export function serviceWorkerNotifySnackbar ( options : { lastNotifyVersion : string ; changelogPage ?: string , currentVersion : string } ) : void {
23
23
logger . logMethodArgs ?.( 'serviceWorkerNotifyHandler' , { options} ) ;
24
24
25
25
serviceWorkerSignal . subscribe ( ( { event} ) => {
@@ -51,7 +51,7 @@ export function serviceWorkerNotifySnackbar(options: {lastNotifyVersion: string;
51
51
const lastLocalVersion = localStorage . getItem ( notifyLocalStorageKey ) ;
52
52
if ( lastLocalVersion !== null ) {
53
53
localStorage . removeItem ( notifyLocalStorageKey ) ;
54
- const message = `به نسخه ${ l10n . replaceNumber ( __package_version__ . replace ( '-alpha' , '-آلفا' ) ) } خوشآمدید.` ;
54
+ const message = `به نسخه ${ l10n . replaceNumber ( options . currentVersion . replace ( '-alpha' , '-آلفا' ) ) } خوشآمدید.` ;
55
55
56
56
/**
57
57
* Handles the display of a snackbar notification based on the service worker event.
@@ -60,7 +60,7 @@ export function serviceWorkerNotifySnackbar(options: {lastNotifyVersion: string;
60
60
* Otherwise, it shows a snackbar with a close button.
61
61
*/
62
62
if (
63
- ( options . changelogPage != null && options . lastNotifyVersion === __package_version__ ) ||
63
+ ( options . changelogPage != null && options . lastNotifyVersion === options . currentVersion ) ||
64
64
lastLocalVersion === '' ||
65
65
isVersionLarger ( options . lastNotifyVersion , lastLocalVersion )
66
66
) {
0 commit comments