fix(plugins/staff-settings): don't show toast at startup
This commit is contained in:
parent
b1d65fbda2
commit
9525f98289
1 changed files with 10 additions and 7 deletions
|
|
@ -20,13 +20,20 @@ registerInternalPlugin(
|
||||||
icon: 'StaffBadgeIcon',
|
icon: 'StaffBadgeIcon',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
start({ cleanup, logger }) {
|
start({ cleanup, logger, plugin }) {
|
||||||
const CircleInformationIcon = lookupGeneratedIconComponent(
|
const CircleInformationIcon = lookupGeneratedIconComponent(
|
||||||
'CircleInformationIcon',
|
'CircleInformationIcon',
|
||||||
'CircleInformationIcon-secondary',
|
'CircleInformationIcon-secondary',
|
||||||
'CircleInformationIcon-primary',
|
'CircleInformationIcon-primary',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const showToast = () =>
|
||||||
|
ToastActionCreators.open({
|
||||||
|
key: 'staff-settings-action',
|
||||||
|
content: 'Navigate out of Settings to apply changes',
|
||||||
|
IconComponent: CircleInformationIcon,
|
||||||
|
})
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
getStore<{
|
getStore<{
|
||||||
initialize(): void
|
initialize(): void
|
||||||
|
|
@ -43,12 +50,6 @@ registerInternalPlugin(
|
||||||
|
|
||||||
store.initialize()
|
store.initialize()
|
||||||
unpatch()
|
unpatch()
|
||||||
|
|
||||||
ToastActionCreators.open({
|
|
||||||
key: 'staff-settings-action',
|
|
||||||
content: 'Navigate out of Settings to apply changes',
|
|
||||||
IconComponent: CircleInformationIcon,
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,9 +70,11 @@ registerInternalPlugin(
|
||||||
).getCurrentUser(),
|
).getCurrentUser(),
|
||||||
),
|
),
|
||||||
reset,
|
reset,
|
||||||
|
showToast,
|
||||||
)
|
)
|
||||||
|
|
||||||
reset()
|
reset()
|
||||||
|
if (plugin.startedLate) showToast()
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue