fix(mysql): prevalidate routine saves and support procedure refresh
This commit is contained in:
1 parent
0023c03520
commit
4ac2c5dc40
16 files changed
+173
-20
No files matched your search
@@ -2873,6 +2873,26 @@ export const useQueryStore = defineStore("query", () => {
|
||||
void loadObjectSourceIntoTab(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Force-reload an object-source tab from the database (user-triggered refresh).
|
||||
* Callers should confirm before discarding dirty edits.
|
||||
*/
|
||||
function refreshObjectSourceTab(id: string): boolean {
|
||||
const tab = tabs.value.find((candidate) => candidate.id === id);
|
||||
if (!tab) return false;
|
||||
if (tab.sourceLoad && !tab.sourceLoad.error) return true;
|
||||
const request = tab.sourceLoad?.request ? { ...tab.sourceLoad.request } : tab.objectSource ? { name: tab.objectSource.name, objectType: tab.objectSource.objectType, signature: tab.objectSource.signature } : null;
|
||||
if (!request) return false;
|
||||
sourceRevalidateInFlight.delete(id);
|
||||
tab.sourceLoad = {
|
||||
startedAt: Date.now(),
|
||||
initialEditing: tab.sourceLoad?.initialEditing ?? !!tab.objectSource,
|
||||
request,
|
||||
};
|
||||
void loadObjectSourceIntoTab(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
function clearObjectSourceLoad(tab: QueryTab) {
|
||||
tab.sourceLoad = undefined;
|
||||
}
|
||||
@@ -9006,6 +9026,7 @@ export const useQueryStore = defineStore("query", () => {
|
||||
openObjectSourceTab,
|
||||
openObjectSourceTabPending,
|
||||
retryObjectSourceTab,
|
||||
refreshObjectSourceTab,
|
||||
showExecutedQueryResults,
|
||||
focusGroup,
|
||||
activateTab,
|
||||
|
||||
Reference in new issue
Block a user