Show warning if there's uncommitted changes (#92)
This commit is contained in:
@@ -21,6 +21,15 @@ export const showError = (message: any) => {
|
||||
console.error(message);
|
||||
};
|
||||
|
||||
/**
|
||||
* Show a warning toast
|
||||
* @param message The warning message to display
|
||||
*/
|
||||
export const showWarning = (message: string) => {
|
||||
toast.warning(message);
|
||||
console.warn(message);
|
||||
};
|
||||
|
||||
/**
|
||||
* Show an info toast
|
||||
* @param message The info message to display
|
||||
@@ -49,5 +58,12 @@ export const showLoading = <T>(
|
||||
});
|
||||
};
|
||||
|
||||
export const showUncommittedFilesWarning = (files: string[]) => {
|
||||
showWarning(
|
||||
`Some changed files were not committed. Please use git to manually commit them.
|
||||
\n\n${files.join("\n")}`
|
||||
);
|
||||
};
|
||||
|
||||
// Re-export for direct use
|
||||
export { toast };
|
||||
|
||||
Reference in New Issue
Block a user