Skip to content

fix: (AdvancedFragment.java) save pre-shared key correctly - #79

Merged
pappz merged 4 commits into
netbirdio:mainfrom
nev-al:main
Sep 13, 2025
Merged

pappz merged 4 commits into
netbirdio:mainfrom
nev-al:main

Conversation

@nev-al

@nev-al nev-al commented Sep 7, 2025 •

Copy link
Copy Markdown
Contributor

Description

Add preferences.commit() call to save pre-shared key correctly and show user feedback via Toast messages.

Related Issue

Closes #78

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

@pappz

pappz commented Sep 10, 2025

Copy link
Copy Markdown
Collaborator

@nev-al Thank you for the PR. Please provide a summary for the PR message.

@nev-al

nev-al commented Sep 11, 2025

Copy link
Copy Markdown
Contributor Author

I'm sorry, @pappz. I edited the first message.

try {
preferences.setPreSharedKey(key);
preferences.commit();
Toast.makeText(context, "Pre-shared key saved successfully", Toast.LENGTH_SHORT).show();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please move the string to strings.xml value file

preferences.commit();
Toast.makeText(context, "Pre-shared key saved successfully", Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Log.e(LOGTAG, "Failed to save pre-shared key", e);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please move the string to strings.xml value file

@pappz
pappz merged commit 62861bf into netbirdio:main Sep 13, 2025
1 check 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.

[Bug] Impossible to save a preshared key

2 participants