0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-01-24 02:09:33 +01:00

remove return value, not yet needed

This commit is contained in:
silverwind 2025-12-17 21:41:15 +01:00
parent f10ab8d9b0
commit f30f4a002e
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443

View File

@ -10,11 +10,9 @@ export function setLocalStorageSetting(key: string, value: string) {
/** Add a listener to the 'storage' event for given setting key. This event only fires in non-current tabs. */
export function addLocalStorageChangeListener(key: string, listener: (e: StorageEvent) => void) {
const fn = (e: StorageEvent) => {
window.addEventListener('storage', (e: StorageEvent) => {
if (e.storageArea === localStorage && e.key === key) {
listener(e);
}
};
window.addEventListener('storage', fn);
return fn; // for unregister
});
}