Skip to content

Commit

Permalink
Reload widget when the user is already signed in (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
danipv authored Jun 28, 2024
1 parent e889fc1 commit d46d95b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 27 deletions.
20 changes: 10 additions & 10 deletions dist/vt-augment.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@virustotal/vt-augment",
"version": "1.7.3",
"version": "1.7.4",
"description": "Client library that wraps common patterns when interact with the VirusTotal Augment product",
"main": "dist/vt-augment.min.js",
"keywords": [
Expand Down
21 changes: 5 additions & 16 deletions src/vt-augment.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,25 +167,18 @@ class VTAugment {
this.loading(true);
const iframe = this.container.querySelector('iframe');
if (iframe) {
iframe.src = SafeUrl.unwrap(safeUrl);
const eventMessage = {
'action': 'VTAUGMENT:IFRAME:LOAD',
'payload': SafeUrl.unwrap(safeUrl),
}
iframe.contentWindow.postMessage(eventMessage, '*');
} else {
this.createIframe_(this.container, safeUrl);
}

return this;
}

/**
* @export
* @return {!VTAugment}
*/
reload() {
this.loading(true);
const iframe = this.container.querySelector('iframe');
iframe.src = iframe.src
return this;
}

/**
* @export
* @return {!VTAugment}
Expand Down Expand Up @@ -317,10 +310,6 @@ class VTAugment {
case 'VTAUGMENT:CLOSE':
this.closeDrawer();
break;
case 'VTAUGMENT:CLEAR_CACHE':
case 'VTAUGMENT:RELOAD':
this.reload();
break;
default:
}
}
Expand Down

0 comments on commit d46d95b

Please sign in to comment.