Load config.json at runtime
This commit is contained in:
parent
01c0eb503f
commit
589c52f4cd
11 changed files with 71 additions and 39 deletions
|
|
@ -3,7 +3,6 @@ import sdk from "matrix-js-sdk";
|
|||
import { TimelineWindow, EventTimeline } from "matrix-js-sdk";
|
||||
import util from "../plugins/utils";
|
||||
import User from "../models/user";
|
||||
import config from "../assets/config";
|
||||
|
||||
const LocalStorageCryptoStore = require("matrix-js-sdk/lib/crypto/store/localStorage-crypto-store")
|
||||
.LocalStorageCryptoStore;
|
||||
|
|
@ -120,7 +119,7 @@ export default {
|
|||
promiseLogin = tempMatrixClient
|
||||
.register(user, pass, null, {
|
||||
type: "m.login.dummy",
|
||||
initial_device_display_name: config.appName
|
||||
initial_device_display_name: this.$config.appName
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("Response", response);
|
||||
|
|
@ -132,7 +131,7 @@ export default {
|
|||
return u;
|
||||
})
|
||||
} else {
|
||||
var data = { user: User.localPart(user.user_id), password: user.password, type: "m.login.password", initial_device_display_name: config.appName };
|
||||
var data = { user: User.localPart(user.user_id), password: user.password, type: "m.login.password", initial_device_display_name: this.$config.appName };
|
||||
if (user.device_id) {
|
||||
data.device_id = user.device_id;
|
||||
}
|
||||
|
|
@ -297,7 +296,7 @@ export default {
|
|||
if (this.ready) {
|
||||
return Promise.resolve(this.currentUser);
|
||||
}
|
||||
return this.$store.dispatch("login", this.currentUser || new User(config.defaultServer, "", "", true));
|
||||
return this.$store.dispatch("login", this.currentUser || new User(this.$config.defaultServer, "", "", true));
|
||||
},
|
||||
|
||||
addMatrixClientListeners(client) {
|
||||
|
|
@ -736,7 +735,7 @@ export default {
|
|||
return this.matrixClient;
|
||||
})
|
||||
} else {
|
||||
const tempMatrixClient = sdk.createClient(config.defaultServer);
|
||||
const tempMatrixClient = sdk.createClient(this.$config.defaultServer);
|
||||
var tempUserString = this.$store.state.tempuser;
|
||||
var tempUser = null;
|
||||
if (tempUserString) {
|
||||
|
|
@ -753,7 +752,7 @@ export default {
|
|||
clientPromise = tempMatrixClient
|
||||
.register(user, pass, null, {
|
||||
type: "m.login.dummy",
|
||||
initial_device_display_name: config.appName
|
||||
initial_device_display_name: this.$config.appName
|
||||
})
|
||||
.then((response) => {
|
||||
console.log("Response", response);
|
||||
|
|
@ -766,7 +765,7 @@ export default {
|
|||
|
||||
// Get an access token
|
||||
clientPromise = clientPromise.then(user => {
|
||||
var data = { user: User.localPart(user.user_id), password: user.password, type: "m.login.password", initial_device_display_name: config.appName };
|
||||
var data = { user: User.localPart(user.user_id), password: user.password, type: "m.login.password", initial_device_display_name: this.$config.appName };
|
||||
if (user.device_id) {
|
||||
data.device_id = user.device_id;
|
||||
}
|
||||
|
|
@ -779,7 +778,7 @@ export default {
|
|||
// Only used to get public room info from.
|
||||
clientPromise = clientPromise.then(user => {
|
||||
var opts = {
|
||||
baseUrl: config.defaultServer,
|
||||
baseUrl: this.$config.defaultServer,
|
||||
userId: user.user_id,
|
||||
accessToken: user.access_token,
|
||||
timelineSupport: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue