Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it("redirect to promo scene", function(done){
statem.start();
expect(statem.promoScene.active).to.be.false;
when (()=>statem.promoScene.active, done);
});
// it("expect login scene with history", function(done){
);
this.props.RootStore.userStore.registryContract = contract;
window.registryContract = contract;
},
);
when(
() => this.props.RootStore.userStore.userAddr && this.props.RootStore.finishInitMetamaskNetwork,
() => {
this.props.RootStore.userStore.resetClaimLists();
this.props.RootStore.userStore.populateClaimLists();
this.props.RootStore.userStore.getValidClaims();
},
);
// Initilize Fixed Account, get claims from smart contract
when(
() => this.props.RootStore.userStore.isOnFixedAccount && this.props.RootStore.finishInitNetwork,
() => {
const contract = new window.web3.eth.Contract(
identityRegistryJson.abi,
this.props.RootStore.userStore.registryContractAddr,
);
this.props.RootStore.userStore.registryContract = contract;
window.registryContract = contract;
this.props.RootStore.userStore.populateClaimLists();
this.props.RootStore.userStore.getValidClaims();
},
);
when(
() => this.props.RootStore.commonStore.isWalletSetupDone,
registerReactions() {
// Switch account reactions.
when(
() => this.switched,
this.switchAccountHandler
);
}
export function virtualPageView({ selectedItem }, comScoreIds, titleMatches) {
// Executes disposer if there is a pending pageview.
if (typeof disposer === 'function') {
disposer();
disposer = null;
}
// Gets single from selected item.
const { title } = selectedItem.entity.headMeta;
// Waits for the correct url and title and then sends beacons.
disposer = when(
() => selectedItem.entity.isReady,
async () => {
await titleMatches(title);
if (window.COMSCORE) comScoreIds.forEach(id => window.COMSCORE.beacon({ c1: '2', c2: id }));
},
);
}
setup() {
when(this._isRefresh, this._redirectToLoading);
Promise.all([loadRustModule(), loadLovefieldDB()])
.then(async () => {
await this._openPageAfterLoad();
runInAction(() => {
this.error = null;
this._loading = false;
});
return undefined;
})
.catch((error) => {
console.error('LoadingStore::setup Unable to load libraries', error);
runInAction(() => {
this.error = localizedError(new UnableToLoadError());
this._loading = false;
});
});
componentDidMount() {
when(
() => Account.user && Account.user.id !== null,
this.updateOptions,
);
}
afterCreate() {
disposables.push(
when(
() => self.account.isLoggedIn && !self.activeDevice,
() => {
if (self.account.devices.length === 1) {
self.setActiveDevice(self.account.devices[0])
}
},
),
)
disposables.push(
autorun(() => {
if (self.activeDevice) {
self.activeDevice.fetchSections()
}
}),
)
componentDidMount() {
this.chart = new ChartConfig(this.chartConfig as any, { isEmbed: true })
this.dispose2 = when(
() => this.chart !== undefined && this.chart.data.isReady,
() => this.chartIsReady(this.chart as ChartConfig)
)
this.dispose = autorun(() => {
const chart = this.chart
const display = _.clone(this.newVariable.display)
if (chart) {
runInAction(() => (chart.props.dimensions[0].display = display))
}
})
}
public async verifyReleaseChannelEnabled(channel: string): Promise {
this.appState.setWarningDialogTexts({
label: `You're loading an example with a version of Electron with an unincluded release
channel (${channel}). Do you want to enable the release channel to load the
version of Electron from the example?`
});
this.appState.isWarningDialogShowing = true;
await when(() => !this.appState.isWarningDialogShowing);
return !!this.appState.warningDialogLastResult;
}