Changed: Store termux-widget token synchronously to the SharedPreferences file on creation

Attempt to solve termux/termux-widget#16
This commit is contained in:
agnostic-apollo
2021-09-23 04:58:14 +05:00
parent fefbf2ec03
commit 4f66786b98

View File

@@ -84,7 +84,7 @@ public class TermuxWidgetAppSharedPreferences {
String token = SharedPreferenceUtils.getString(mSharedPreferences, TERMUX_WIDGET_APP.KEY_TOKEN, null, true);
if (token == null) {
token = UUID.randomUUID().toString();
SharedPreferenceUtils.setString(mSharedPreferences, TERMUX_WIDGET_APP.KEY_TOKEN, token, false);
SharedPreferenceUtils.setString(mSharedPreferences, TERMUX_WIDGET_APP.KEY_TOKEN, token, true);
}
return token;
}