Skip to content

Commit

Permalink
fix: force refresh only for v2 and when refresh failed (#596)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo authored Aug 14, 2024
1 parent 6806583 commit 6f27348
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,27 +318,33 @@ export default class SpreadsheetUpload extends ManagedObject {
Log.error("Failed to refresh binding in V4 FE context: " + error);
}
} else if (context.extensionAPI) {
let refreshFailed = false;
// refresh binding in V2 FE context
if (context.extensionAPI.refresh) {
try {
context.extensionAPI.refresh(binding.getPath(id));
} catch (error) {
Log.error("Failed to refresh binding in Object Page V2 FE context: " + error);
refreshFailed = true;
}
}
if (context.extensionAPI.refreshTable) {
try {
context.extensionAPI.refreshTable(id);
} catch (error) {
Log.error("Failed to refresh binding in List Report V2 FE context: " + error);
refreshFailed = true;
}
}
// try refresh binding when refresh failed
if (refreshFailed) {
try {
// force refresh only available for v2
binding.refresh(true);
} catch (error) {
Log.error("Failed to refresh binding in other contexts: " + error);
}
}
}
// try refresh binding either way
try {
binding.refresh(true);
} catch (error) {
Log.error("Failed to refresh binding in other contexts: " + error);
}
}

Expand Down

0 comments on commit 6f27348

Please sign in to comment.