-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48323 from nextcloud/chore/legacy-updatenotification
refactor(updatenotification): Migrate legacy code
- Loading branch information
Showing
25 changed files
with
302 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
import { showInfo } from '@nextcloud/dialogs' | ||
import { loadState } from '@nextcloud/initial-state' | ||
import { t } from '@nextcloud/l10n' | ||
|
||
interface IUpdateNotificationState { | ||
updateLink: string | ||
updateVersion: string | ||
} | ||
|
||
/** | ||
* This only gets loaded if an update is available and the notifications app is not enabled for the user. | ||
*/ | ||
window.addEventListener('DOMContentLoaded', function() { | ||
const { updateLink, updateVersion } = loadState<IUpdateNotificationState>('updatenotification', 'updateState') | ||
const text = t('core', '{version} is available. Get more information on how to update.', { version: updateVersion }) | ||
|
||
// On click open the update link in a new tab | ||
showInfo(text, { onClick: () => window.open(updateLink, '_blank') }) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.