Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

Commit

Permalink
change imports to promises
Browse files Browse the repository at this point in the history
  • Loading branch information
LukePulverenti committed Mar 16, 2018
1 parent 0280404 commit 85159b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions apiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function getServerAddress(server, mode) {
class ApiClient {
constructor(
appStorage,
wakeOnLanModulePath,
wakeOnLanFn,
serverAddress,
appName,
appVersion,
Expand All @@ -151,7 +151,7 @@ class ApiClient {
console.log(`ApiClient deviceId: ${deviceId}`);

this.appStorage = appStorage;
this.wakeOnLanModulePath = wakeOnLanModulePath;
this.wakeOnLanFn = wakeOnLanFn;
this._serverInfo = {};
this._serverAddress = serverAddress;
this._deviceId = deviceId;
Expand Down Expand Up @@ -3911,7 +3911,7 @@ function getCachedWakeOnLanInfo(instance) {

function refreshWakeOnLanInfoIfNeeded(instance) {

import(instance.wakeOnLanModulePath).then(wakeOnLan => {
instance.wakeOnLanFn().then(wakeOnLan => {
if (!wakeOnLan.default.isSupported()) {
return;
}
Expand All @@ -3930,7 +3930,7 @@ function refreshWakeOnLanInfo() {
const instance = this;

console.log('refreshWakeOnLanInfo');
instance.getWakeOnLanInfo().then(info => {
instance.wakeOnLanFn().then(info => {

const serverId = instance.serverId();
instance.appStorage.setItem(`server-${serverId}-wakeonlaninfo`, JSON.stringify(info));
Expand All @@ -3952,7 +3952,7 @@ function sendNextWakeOnLan(instance, infos, index, resolve) {

console.log(`sending wakeonlan to ${info.MacAddress}`);

import(instance.wakeOnLanModulePath).then(wakeOnLan => {
instance.wakeOnLanFn().then(wakeOnLan => {
wakeOnLan.default.send(info).then(result => {

sendNextWakeOnLan(infos, index + 1, resolve);
Expand Down
4 changes: 2 additions & 2 deletions connectionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default class ConnectionManager {
credentialProvider,
appStorage,
apiClientFactory,
serverDiscoveryModulePath,
serverDiscoveryFn,
wakeOnLanModulePath,
appName,
appVersion,
Expand Down Expand Up @@ -830,7 +830,7 @@ export default class ConnectionManager {
resolve(servers);
};

import(serverDiscoveryModulePath).then(serverDiscovery => {
serverDiscoveryFn().then(serverDiscovery => {
serverDiscovery.default.findServers(1000).then(onFinish, () => {
onFinish([]);
});
Expand Down

0 comments on commit 85159b4

Please sign in to comment.