1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-18 02:41:15 +02:00

proper typings

This commit is contained in:
Kyle Spearrin 2018-01-24 13:27:58 -05:00
parent 020520729c
commit d9fb4f2d67
2 changed files with 13 additions and 14 deletions

View File

@ -1,5 +1,8 @@
import { CipherType } from 'jslib/enums'; import { CipherType } from 'jslib/enums';
import { CipherView } from 'jslib/models/view/cipherView';
import { LoginView } from 'jslib/models/view/loginView';
import { ConstantsService } from 'jslib/services/constants.service'; import { ConstantsService } from 'jslib/services/constants.service';
import { UtilsService } from 'jslib/services/utils.service'; import { UtilsService } from 'jslib/services/utils.service';
@ -176,20 +179,16 @@ export default class RuntimeBackground {
this.main.loginsToAdd.splice(i, 1); this.main.loginsToAdd.splice(i, 1);
const cipher = await this.cipherService.encrypt({ const loginModel = new LoginView();
id: null, loginModel.uri = loginInfo.uri;
folderId: null, loginModel.username = loginInfo.username;
favorite: false, loginModel.password = loginInfo.password;
name: loginInfo.name, const model = new CipherView();
notes: null, model.name = loginInfo.name;
type: CipherType.Login, model.type = CipherType.Login;
login: { model.login = loginModel;
uri: loginInfo.uri,
username: loginInfo.username,
password: loginInfo.password,
},
});
const cipher = await this.cipherService.encrypt(model);
await this.cipherService.saveWithServer(cipher); await this.cipherService.saveWithServer(cipher);
this.analytics.ga('send', { this.analytics.ga('send', {
hitType: 'event', hitType: 'event',

View File

@ -158,7 +158,7 @@ export class SettingsController {
rate() { rate() {
this.$analytics.eventTrack('Rate Extension'); this.$analytics.eventTrack('Rate Extension');
BrowserApi.createNewTab(RateUrls[this.platformUtilsService.getDevice()]); BrowserApi.createNewTab((RateUrls as any)[this.platformUtilsService.getDevice()]);
} }
} }