diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fdfa351d..3e7d26470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Localization error in FoodChain #1608 - Alignment issue in Abacus #1607 - Blank screen on iOS when opening a PDF #1618 +- Journal instance pop up remain after launching a PDF or an external app #1619 ## [1.8.0] - 2024-04-10 ### Added diff --git a/js/homeview.js b/js/homeview.js index f1bf0dc7e..dad110474 100644 --- a/js/homeview.js +++ b/js/homeview.js @@ -50,6 +50,7 @@ enyo.kind({ this.restrictedModeInfo = { start: 0 }; util.hideNativeToolbar(); this.tutorialActivity = null; + this.forbiddenActivity = null; this.eeMode = null; // Load and sort journal @@ -546,7 +547,7 @@ enyo.kind({ util.vibrate(); var help = activity.id == tutorial.activityId; preferences.runActivity(activity, undefined, null, null, help); - this.postRunActivity(activity.isNative); + this.postRunActivity(activity.id, activity.isNative); }, runOldActivity: function(activity, instance) { // Run an old activity instance @@ -561,12 +562,14 @@ enyo.kind({ util.vibrate(); var help = tutorial.isLaunched() && activity.id == tutorial.activityId; preferences.runActivity(activity, null, null, null, help); - this.postRunActivity(activity.isNative); + this.postRunActivity(activity.id, activity.isNative); }, - postRunActivity: function(isNative) { + postRunActivity: function(id, isNative) { // When run a native activity, should update journal and view to reflect journal change if (window.sugarizerOS && isNative) { sugarizerOS.popupTimer = new Date(); + this.getPopup().hidePopup(); + this.forbiddenActivity = id; this.loadJournal(); activities.loadEntries(); this.draw(); @@ -582,12 +585,16 @@ enyo.kind({ showActivityPopup: function(icon) { // Create popup if (window.sugarizerOS) { + if (this.forbiddenActivity && this.forbiddenActivity == icon.icon.id) { + return; + } var now = new Date(); if (sugarizerOS.popupTimer && now.getTime() - sugarizerOS.popupTimer.getTime() < 3000) { return; } sugarizerOS.popupTimer = now; } + this.forbiddenActivity = null; var title; var activity = icon.icon; // HACK: activity is stored as an icon if (activity.instances !== undefined && activity.instances.length > 0 && activity.instances[0].metadata.title !== undefined) { diff --git a/js/journal.js b/js/journal.js index 238b9df15..372e1dcd6 100644 --- a/js/journal.js +++ b/js/journal.js @@ -53,6 +53,7 @@ enyo.kind({ this.journalType = constant.journalLocal; this.smallTime = false; this.dialogAction = -1; + this.forbiddenObjectId = null; this.journalChanged(); this.$.footer.setShowing(preferences.getNetworkId() != null && preferences.getPrivateJournal() != null && preferences.getSharedJournal() != null); if (l10n.language.direction == "rtl") { @@ -474,6 +475,7 @@ enyo.kind({ var that = this; this.loadEntry(activity, function(err, metadata, text) { that.$.activityPopup.hidePopup(); + that.forbiddenObjectId = activity.objectId; // To avoid display of the popup util.openAsDocument(metadata, text, activity.objectId); return; }); @@ -619,6 +621,10 @@ enyo.kind({ if (!icon.owner) { return; } + if (this.forbiddenObjectId && icon.data && icon.data.objectId == this.forbiddenObjectId) { + return; + } + this.forbiddenObjectId = null; var activity = icon.icon; // HACK: activity is stored as an icon var entry = icon.getData(); var title = null; diff --git a/js/listview.js b/js/listview.js index 0c07573b8..149c025bb 100755 --- a/js/listview.js +++ b/js/listview.js @@ -33,6 +33,7 @@ enyo.kind({ this.scrollbar_session_value = 0; this.scroll_count = 0; this.favoriteActivityButton = null; + this.forbiddenActivity = null; if (!window.sugarizerOS) { this.activitiesChanged(); this.computeSize(); @@ -207,12 +208,17 @@ enyo.kind({ // Start a new activity instance util.vibrate(); this.$.activityPopup.hidePopup(); + this.forbiddenActivity = activity.id; preferences.runActivity(activity, null); }, // Popup menu handling showActivityPopup: function(icon) { // Create popup + if (window.sugarizerOS && this.forbiddenActivity && this.forbiddenActivity == icon.icon.id) { + return; + } + this.forbiddenActivity = null; var activity = icon.icon; this.$.activityPopup.setHeader({ icon: activity,