Skip to content

Commit

Permalink
c'è per forza, altrimenti k.success == false
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdi2005 committed Jul 26, 2021
1 parent d38225c commit d8973e7
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions app/controllers/upload/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,7 @@ function triggerDeletion(uuid, user_initiated = false){
keychainItem.addEventListener("read", function(k){
if (k.success == true) {
// Cancella la registrazione
var keychainItem = Identity.createKeychainItem({ identifier: "token" });
keychainItem.fetchExistence({
result: function(e) {
Ti.API.log("item exists");
keychainItem.reset();
}
});
keychainItem.reset();

Ti.App.Properties.setBool("registrato", false);
Ti.App.Properties.setBool("autorizzato", false);
Expand Down Expand Up @@ -312,13 +306,18 @@ $.config.addEventListener("open", function(e) {
if (Ti.App.Properties.getBool("registrato", false) == false) {
// Elimina un eventuale token già presente (risolve un bug su iOS per cui alla reinstallazione dell'app persisteva il keychainItem
var keychainItem = Identity.createKeychainItem({ identifier: "token" });
keychainItem.fetchExistence({
result: function(e) {
if (e.exists == true) {
keychainItem.reset();
if (OS_ANDROID) {
keychainItem.fetchExistence({
result: function(e) {
Ti.API.log(JSON.stringify(e));
if (e.exists == true) {
keychainItem.reset();
}
}
}
});
});
} else {
keychainItem.reset();
}

const GENERATED_TOKEN = Titanium.Platform.createUUID();
var credentials = {
Expand Down

0 comments on commit d8973e7

Please sign in to comment.