added translations and logic fix

This commit is contained in:
Kelvin
2025-01-14 01:00:51 -03:00
parent ab70ff10be
commit 2e7a2a05a5
29 changed files with 168 additions and 9 deletions

View File

@@ -98,6 +98,7 @@ export function SettingsDownloadSources() {
showSuccessToast(t("removed_download_sources"));
getDownloadSources();
setIsRemovingDownloadSource(false);
setShowConfirmationDeleteAllSourcesModal(false);
channel.close();
updateRepacks();
@@ -151,15 +152,14 @@ export function SettingsDownloadSources() {
onClose={handleModalClose}
onAddDownloadSource={handleAddDownloadSource}
/>
<ConfirmationModal
cancelButtonLabel="Não"
confirmButtonLabel="Sim, excluir"
descriptionText="Você ira excluir todas as fontes de dowload"
cancelButtonLabel={t("cancel_button_confirmation_delete_all_sources")}
confirmButtonLabel={t("confirm_button_confirmation_delete_all_sources")}
descriptionText={t("description_confirmation_delete_all_sources")}
clickOutsideToClose={false}
onConfirm={handleRemoveAllDowloadSources}
visible={showConfirmationDeleteAllSourcesModal}
title={"Excluir todas as fontes de dowload"}
title={t("title_confirmation_delete_all_sources")}
onClose={() => setShowConfirmationDeleteAllSourcesModal(false)}
buttonsIsDisabled={isRemovingDownloadSource}
/>
@@ -254,7 +254,7 @@ export function SettingsDownloadSources() {
disabled={isRemovingDownloadSource}
>
<XIcon />
Remover todas as fontes de dowload
{t("button_delete_all_sources")}
</Button>
</div>
)}

View File

@@ -115,7 +115,7 @@ const deleteDownloadSource = async (id: number) => {
});
};
const deleteAllDowloadsSources = async () => {
const deleteAllDowloadSources = async () => {
await db.transaction("rw", repacksTable, downloadSourcesTable, async () => {
await repacksTable.clear();
await downloadSourcesTable.clear();
@@ -141,7 +141,7 @@ self.onmessage = async (event: MessageEvent<Payload>) => {
}
if (type === "DELETE_ALL_DOWNLOAD_SOURCES") {
await deleteAllDowloadsSources();
await deleteAllDowloadSources();
const channel = new BroadcastChannel(`download_sources:delete_all:${data}`);