optimize(utils): Reduce code indentation and improve readability (#496)
This commit is contained in:
parent
cd9d58d4de
commit
ad2f24707a
@ -12,40 +12,42 @@ export function setupAppVersionNotification() {
|
||||
|
||||
const buildTime = await getHtmlBuildTime();
|
||||
|
||||
if (buildTime !== BUILD_TIME) {
|
||||
isShow = true;
|
||||
|
||||
const n = window.$notification?.create({
|
||||
title: $t('system.updateTitle'),
|
||||
content: $t('system.updateContent'),
|
||||
action() {
|
||||
return h('div', { style: { display: 'flex', justifyContent: 'end', gap: '12px', width: '325px' } }, [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
onClick() {
|
||||
n?.destroy();
|
||||
}
|
||||
},
|
||||
() => $t('system.updateCancel')
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
type: 'primary',
|
||||
onClick() {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
() => $t('system.updateConfirm')
|
||||
)
|
||||
]);
|
||||
},
|
||||
onClose() {
|
||||
isShow = false;
|
||||
}
|
||||
});
|
||||
if (buildTime === BUILD_TIME) {
|
||||
return;
|
||||
}
|
||||
|
||||
isShow = true;
|
||||
|
||||
const n = window.$notification?.create({
|
||||
title: $t('system.updateTitle'),
|
||||
content: $t('system.updateContent'),
|
||||
action() {
|
||||
return h('div', { style: { display: 'flex', justifyContent: 'end', gap: '12px', width: '325px' } }, [
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
onClick() {
|
||||
n?.destroy();
|
||||
}
|
||||
},
|
||||
() => $t('system.updateCancel')
|
||||
),
|
||||
h(
|
||||
NButton,
|
||||
{
|
||||
type: 'primary',
|
||||
onClick() {
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
() => $t('system.updateConfirm')
|
||||
)
|
||||
]);
|
||||
},
|
||||
onClose() {
|
||||
isShow = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user