init: sudah ganti logo, hilangin setting, dan investigational use dialog

This commit is contained in:
one
2025-03-06 11:32:45 +07:00
commit 8f31d4ed41
2857 changed files with 355646 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
/**
*
* @param action The action function to attempt
* @param attempts The number of attempts to try the action
* @param delay delay between attempts
* @returns True if the action is successful, otherwise throws an error
*/
export const attemptAction = async (action: () => Promise<void>, attempts = 10, delay = 100) => {
for (let i = 1; i < attempts; i++) {
try {
await action();
return true;
} catch (error) {
if (i === attempts) {
throw new Error('Action failed.');
}
await new Promise(resolve => setTimeout(resolve, delay));
}
}
};