Skip to content

Commit

Permalink
fix: on recent browser, display pop-up for notification by asking for…
Browse files Browse the repository at this point in the history
… permissions only on user generated event
  • Loading branch information
LesageYann committed Jun 7, 2022
1 parent 4f5414a commit 1b1415a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Telescope-Cytoscape-Libraries/CYSFileLibrary.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,7 @@ CYSFileLibrary >> cytoscapeTelescopeJs [
createEventFunction(visuWithId) {
const that = this
return function (evt) {
TLJS.enableUserNotification(evt)
that.clearOverInteraction()
that.handleClientSideInteractions(visuWithId.visu, evt)
var visu = visuWithId.visu
Expand Down Expand Up @@ -1243,8 +1244,14 @@ CYSFileLibrary >> cytoscapeTelescopeJs [
}
}

static enableUserNotification() {
this.singleton.enableUserNotification()
static enableUserNotification(evt) {
if(!this.alreadyAskPermissions) {
if(!(["click", "tap", "cxttap", "contextmenu"].includes(evt.type))) {
return null;
}
this.alreadyAskPermissions = true
this.singleton.enableUserNotification()
}
}

enableUserNotification() {
Expand Down Expand Up @@ -1305,8 +1312,6 @@ window.addEventListener("load", () => {


var notify
TLJS.enableUserNotification()


function changeData(command) {
let self = this
Expand Down

0 comments on commit 1b1415a

Please sign in to comment.