Skip to content

Commit c5fef3d

Browse files
committed
refactor to not use then()
1 parent 6717d70 commit c5fef3d

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Frontend/src/stores/MessageStore.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,15 @@ export const useMessageStore = defineStore("MessageStore", () => {
8080
const { configuration } = storeToRefs(configStore);
8181
const error_retention_period = computed(() => timeSpanToDuration(configuration.value?.data_retention?.error_retention_period).asHours());
8282

83-
serviceControlClient
84-
.fetchTypedFromServiceControl<EditAndRetryConfig>("edit/config")
85-
// eslint-disable-next-line promise/prefer-await-to-then
86-
.then(([, data]) => {
83+
async function loadEditAndRetryConfiguration() {
84+
try {
85+
const [, data] = await serviceControlClient.fetchTypedFromServiceControl<EditAndRetryConfig>("edit/config");
8786
edit_and_retry_config.value = data;
88-
return data;
89-
})
90-
// eslint-disable-next-line promise/prefer-await-to-then
91-
.catch(() => {
87+
} catch {
9288
console.warn("Failed to load Edit and Retry configuration");
93-
});
89+
}
90+
}
91+
loadEditAndRetryConfiguration();
9492

9593
function reset() {
9694
state.data = { failure_metadata: {}, failure_status: {}, dialog_status: {}, invoked_saga: {} };

0 commit comments

Comments
 (0)