You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
3.6 KiB
2 lines
3.6 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{1197:function(e,o,n){"use strict";n.r(o),n.d(o,"loadApp",(function(){return U}));var t=n(33),r=n.n(t),i=n(36),a=n(51),s=n(472),c=n(34),l=n(69),d=n(218),f=n(201),u=n(57),g=n.n(u),w=n(15),h=n(37),p=n(45),m=n(87);window.React=r.a;let _=null;function v(e){const o=Object(w.b)(e);return{screen:o.location.substring(1),params:o.params}}function b(e){decodeURIComponent(window.location.hash)!==_&&function(e){if(!window.matrixChat)return;console.log("Routing URL ",e.href);const o=v(e);window.matrixChat.showScreen(o.screen,o.params)}(window.location)}function C(e){console.log("newscreen "+e);const o="#/"+e;_=o,window.location.hash=o}function y(e){let o;o="vector:"===window.location.protocol?"https://riot.im/app/#/register":window.location.protocol+"//"+window.location.host+window.location.pathname+"#/register";const n=Object.keys(e);for(let t=0;t<n.length;++t){o+=0===t?"?":"&";const r=n[t];o+=r+"="+encodeURIComponent(e[r])}return o}function O(){const e=g.a.parse(window.location.href);e.search="";const o=g.a.format(e);console.log(`Redirecting to ${o} to drop loginToken from queryparams`),window.location.href=o}async function U(e){const o=document.body.dataset.vectorIndexeddbWorkerScript;if(!o)throw Object(c.h)(Object(c.b)("Missing indexeddb worker script!"));h.a.setIndexedDbWorkerScript(o),m.a.setConferenceHandler(s),window.addEventListener("hashchange",b);const n=a.a.get(),t=Object(w.a)(window.location),u=window.location.protocol+"//"+window.location.host+window.location.pathname;console.log("Vector starting at "+u),n.startUpdater();const g=await async function(){let e;try{console.log("Verifying homeserver configuration");const o=p.a.get();let n=o.default_server_config;const t=o.default_server_name,r=o.default_hs_url,i=o.default_is_url,a=[n,t,r].filter(e=>!!e);if(a.length>1)throw Object(c.h)(Object(c.b)("Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url."));if(a.length<1)throw Object(c.h)(Object(c.b)("Invalid configuration: no default server specified."));r&&(console.log("Config uses a default_hs_url - constructing a default_server_config using this information"),console.warn("DEPRECATED CONFIG OPTION: In the future, default_hs_url will not be accepted. Please use default_server_config instead."),n={"m.homeserver":{base_url:r}},i&&(n["m.identity_server"]={base_url:i}));let s=null;n&&(console.log("Config uses a default_server_config - validating object"),s=await d.a.fromDiscoveryConfig(n)),t&&(console.log("Config uses a default_server_name - doing .well-known lookup"),console.warn("DEPRECATED CONFIG OPTION: In the future, default_server_name will not be accepted. Please use default_server_config instead."),s=await d.a.findClientConfig(t)),e=l.b.buildValidatedConfigFromDiscovery(t,s,!0)}catch(o){const{hsUrl:n,isUrl:t,userId:r}=f.b();if(!n||!r)throw o;console.error(o),console.warn("A session was found - suppressing config error and using the session's homeserver"),console.log("Using pre-existing hsUrl and isUrl: ",{hsUrl:n,isUrl:t}),e=await l.b.validateServerConfigWithStaticUrls(n,t,!0)}return e.isDefault=!0,console.log("Using homeserver config:",e),console.log("Updating SdkConfig with validated discovery information"),p.a.add({validated_server_config:e}),p.a.get()}(),_=i.getComponent("structures.MatrixChat");return r.a.createElement(_,{onNewScreen:C,makeRegistrationUrl:y,ConferenceHandler:s,config:g,realQueryParams:t,startingFragmentQueryParams:e,enableGuest:!g.disable_guests,onTokenLoginCompleted:O,initialScreenAfterLogin:v(window.location),defaultDeviceDisplayName:n.getDefaultDeviceDisplayName()})}}}]);
|
|
//# sourceMappingURL=riot-web-app.js.map
|