mirror of
https://github.com/nimbold/Firelink.git
synced 2026-08-22 17:06:40 +00:00
fix(properties): harden recovery and window chrome
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export type PropertiesFooterAction = 'discardChanges' | 'save' | 'close' | 'keepEditing';
|
||||
|
||||
export type PropertiesFooterState = {
|
||||
isDirty: boolean;
|
||||
hasUnsavedNavigation: boolean;
|
||||
};
|
||||
|
||||
export const getPropertiesFooterActions = ({
|
||||
isDirty,
|
||||
hasUnsavedNavigation,
|
||||
}: PropertiesFooterState): PropertiesFooterAction[] => {
|
||||
if (hasUnsavedNavigation) return ['discardChanges', 'save', 'keepEditing'];
|
||||
if (isDirty) return ['discardChanges', 'save', 'close'];
|
||||
return ['close'];
|
||||
};
|
||||
Reference in New Issue
Block a user