Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add clear data options #315

Merged
merged 7 commits into from
Sep 1, 2024
Merged

Add clear data options #315

merged 7 commits into from
Sep 1, 2024

Conversation

valentinb102
Copy link
Contributor

Reference issue

Purpose

  • Added 2 options so user can clear just the codes or everything.
  • Reused toggles as checkboxes.

Approach

  • Combined clear codes function with clear data function using 2 bools.
  • Is this the right approach?
  • How should I clear just the settings without clearing codes?

@Levminer
Copy link
Owner

Thanks for your work so far!

  1. The toggles are fine but they should be in a dialog (example:

    export const showManualEntry = () => {
    and
    <dialog class="dialog dialog0">
    )

  2. You can clear only the codes like this:

    export const deleteCodes = async () => {

@valentinb102
Copy link
Contributor Author

How should I clear just the settings? I guess that would be everything excluding codes and the password?

@Levminer
Copy link
Owner

Yes, you can set settings.settings to

{
		language: 0,
		launchOnStartup: true,
		minimizeToTray: true,
		optionalAnalytics: true,
		codesDescription: false,
		blurCodes: false,
		sortCodes: 0,
		codesLayout: 0,	
},

close dialog before navigating
@valentinb102
Copy link
Contributor Author

Should the four warning strings be moved into the localization file?

const confirm0 = await dialog.ask("Are you sure you want to clear 2FA codes? \n\nThis cannot be undone!", { type: "warning" })

const confirm0 = await dialog.ask("Are you sure you want to clear all settings? \n\nThis cannot be undone!", { type: "warning" })

const confirm0 = await dialog.ask("Are you sure you want to clear all data? \n\nThis cannot be undone!", { type: "warning" })

const confirm1 = await dialog.ask("Are you absolutely sure? \n\nThere is no way back!", { type: "warning" })

@Levminer
Copy link
Owner

Its' not necessary.

@valentinb102
Copy link
Contributor Author

So is this PR good to go? I think I added everything.

Copy link
Owner

@Levminer Levminer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the formatting and good to go! Thanks!

Comment on lines 76 to 84
settings.settings.language = 0;
settings.settings.launchOnStartup = true;
settings.settings.minimizeToTray = true;
settings.settings.optionalAnalytics = true;
settings.settings.codesDescription = false;
settings.settings.blurCodes = false;
settings.settings.sortCodes = 0;
settings.settings.codesLayout = 0;
setSettings(settings)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix formatting

@Levminer Levminer merged commit 8305443 into Levminer:dev Sep 1, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants