Merge pull request #810 from mattias-symphony/SDA-1587_Broken_SDA_Demo_App

feat: SDA-1587 Broken functions in demo app
This commit is contained in:
Johan Kwarnmark 2019-11-18 09:49:59 +01:00 committed by GitHub
commit e59de3e989
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 0 deletions

View File

@ -27,6 +27,10 @@
- npm run demo-win (for windows)
- npm run demo-mac (for mac osx)
Remember to set this.origin to '*' in app-bridge.ts when running the demo. Search
for // DEMO-APP: and comment that line back in. Make sure to comment it out again
before you commit.
## Build Instructions:
### Mac

View File

@ -1,3 +1,7 @@
To start the demo from command line do:
- npm install
- npm run demo
Remember to set this.origin to '*' in app-bridge.ts when running the demo. Search
for // DEMO-APP: and comment that line back in. Make sure to comment it out again
before you commit.

View File

@ -25,11 +25,31 @@
border-radius: 50%;
display: inline-block;
}
.origin-reminder {
background: lightyellow;
padding: 20px;
margin: 40px;
border: 2px solid black;
display: block;
}
.origin-reminder-tt {
font-weight: normal;
background: yellow;
padding-left: 10px;
padding-right: 10px;
padding-top: 3px;
padding-bottom: 3px;
}
</style>
<link rel="stylesheet" href="download-manager.css">
</head>
<body>
<h1>Symphony Electron API Demo</h1>
<div class='origin-reminder'>
<p><b>Remember to set <tt class='origin-reminder-tt'>this.origin</tt> to <tt class='origin-reminder-tt'>'*'</tt> in app-bridge.ts when using this API demo</b></p>
<p>Search for <tt class='origin-reminder-tt'>// DEMO-APP:</tt> and comment that line back in.
<u>Make sure to comment it out again before you commit.</u></p>
</div>
<hr>
<p>Notifications:<p>
<button id='notf'>show notification</button>

View File

@ -64,6 +64,7 @@ export class AppBridge {
const currentWindow = remote.getCurrentWindow();
// @ts-ignore
this.origin = currentWindow.origin || '';
// this.origin = '*'; // DEMO-APP: Comment this line back in only to test demo-app - DO NOT COMMIT
if (ssInstance && typeof ssInstance.setBroadcastMessage === 'function') {
ssInstance.setBroadcastMessage(this.broadcastMessage);
}