more tweaking to server consent flow and changing servers on preview

This commit is contained in:
Bruno Windels
2020-12-04 13:59:52 +01:00
parent 4d57b3c5da
commit aa62f1fedc
11 changed files with 88 additions and 32 deletions
+1 -10
View File
@@ -15,6 +15,7 @@ limitations under the License.
*/
import {createEnum} from "./utils/enum.js";
import {orderedUnique} from "./utils/unique.js";
const ROOMALIAS_PATTERN = /^#([^:]*):(.+)$/;
const ROOMID_PATTERN = /^!([^:]*):(.+)$/;
@@ -56,16 +57,6 @@ export const LinkKind = createEnum(
"Event"
)
function orderedUnique(array) {
const copy = [];
for (let i = 0; i < array.length; ++i) {
if (i === 0 || array.lastIndexOf(array[i], i - 1) === -1) {
copy.push(array[i]);
}
}
return copy;
}
export class Link {
static parse(fragment) {
if (!fragment) {