2022-02-15 16:30:30 -07:00
|
|
|
'use strict';
|
|
|
|
|
2022-07-05 16:30:52 -06:00
|
|
|
// Isomorphic script that runs in the browser and on the server for SSR (needs
|
|
|
|
// browser context) that renders Hydrogen to the `document.body`.
|
|
|
|
//
|
|
|
|
// Data is passed in via `window.matrixPublicArchiveContext`
|
|
|
|
|
2022-02-15 00:33:16 -07:00
|
|
|
const assert = require('matrix-public-archive-shared/lib/assert');
|
2022-02-03 22:44:49 -07:00
|
|
|
const {
|
2022-02-01 20:39:23 -07:00
|
|
|
Platform,
|
2022-02-01 22:45:09 -07:00
|
|
|
MediaRepository,
|
2022-02-16 18:58:32 -07:00
|
|
|
createNavigation,
|
|
|
|
createRouter,
|
2022-08-30 18:10:57 -06:00
|
|
|
tag,
|
2022-02-01 20:39:23 -07:00
|
|
|
|
2022-08-30 22:40:07 -06:00
|
|
|
RetainedObservableValue,
|
|
|
|
PowerLevels,
|
|
|
|
|
2022-02-02 00:07:06 -07:00
|
|
|
TilesCollection,
|
2022-02-01 20:39:23 -07:00
|
|
|
FragmentIdComparer,
|
|
|
|
EventEntry,
|
|
|
|
encodeKey,
|
|
|
|
encodeEventIdKey,
|
2022-02-02 00:07:06 -07:00
|
|
|
Timeline,
|
2022-09-20 15:02:09 -06:00
|
|
|
ViewModel,
|
2022-02-10 00:42:02 -07:00
|
|
|
RoomViewModel,
|
2022-02-03 22:44:49 -07:00
|
|
|
} = require('hydrogen-view-sdk');
|
2022-02-01 20:39:23 -07:00
|
|
|
|
2022-02-23 20:25:05 -07:00
|
|
|
const MatrixPublicArchiveURLCreator = require('matrix-public-archive-shared/lib/url-creator');
|
2022-09-20 15:02:09 -06:00
|
|
|
const ArchiveRoomView = require('matrix-public-archive-shared/views/ArchiveRoomView');
|
2022-06-08 13:03:36 -06:00
|
|
|
const ArchiveHistory = require('matrix-public-archive-shared/lib/archive-history');
|
2022-09-20 15:02:09 -06:00
|
|
|
const ArchiveRoomViewModel = require('matrix-public-archive-shared/viewmodels/ArchiveRoomViewModel');
|
|
|
|
const {
|
|
|
|
customTileClassForEntry,
|
|
|
|
} = require('matrix-public-archive-shared/lib/custom-tile-utilities');
|
2022-08-30 18:10:57 -06:00
|
|
|
|
2022-02-16 22:08:18 -07:00
|
|
|
const fromTimestamp = window.matrixPublicArchiveContext.fromTimestamp;
|
|
|
|
assert(fromTimestamp);
|
2022-09-20 15:02:09 -06:00
|
|
|
const toTimestamp = window.matrixPublicArchiveContext.toTimestamp;
|
|
|
|
assert(toTimestamp);
|
2022-02-14 22:20:25 -07:00
|
|
|
const roomData = window.matrixPublicArchiveContext.roomData;
|
2022-02-10 00:42:02 -07:00
|
|
|
assert(roomData);
|
2022-02-14 22:20:25 -07:00
|
|
|
const events = window.matrixPublicArchiveContext.events;
|
2022-02-09 00:49:02 -07:00
|
|
|
assert(events);
|
2022-02-14 22:20:25 -07:00
|
|
|
const stateEventMap = window.matrixPublicArchiveContext.stateEventMap;
|
2022-02-09 00:49:02 -07:00
|
|
|
assert(stateEventMap);
|
2022-09-20 15:02:09 -06:00
|
|
|
const shouldIndex = window.matrixPublicArchiveContext.shouldIndex;
|
|
|
|
assert(shouldIndex !== undefined);
|
2022-02-14 22:20:25 -07:00
|
|
|
const config = window.matrixPublicArchiveContext.config;
|
2022-02-09 00:49:02 -07:00
|
|
|
assert(config);
|
|
|
|
assert(config.matrixServerUrl);
|
2022-02-16 18:58:32 -07:00
|
|
|
assert(config.basePath);
|
2022-02-09 00:49:02 -07:00
|
|
|
|
2022-02-23 20:25:05 -07:00
|
|
|
const matrixPublicArchiveURLCreator = new MatrixPublicArchiveURLCreator(config.basePath);
|
|
|
|
|
2022-09-20 15:02:09 -06:00
|
|
|
let txnCount = 0;
|
|
|
|
function getFakeEventId() {
|
|
|
|
txnCount++;
|
|
|
|
return `fake-event-id-${new Date().getTime()}--${txnCount}`;
|
|
|
|
}
|
|
|
|
|
2022-02-17 19:40:48 -07:00
|
|
|
function addSupportClasses() {
|
|
|
|
const input = document.createElement('input');
|
|
|
|
input.type = 'month';
|
|
|
|
const isMonthTypeSupported = input.type === 'month';
|
|
|
|
|
|
|
|
// Signal `<input type="month">` support to our CSS
|
|
|
|
document.body.classList.toggle('fallback-input-month', !isMonthTypeSupported);
|
|
|
|
}
|
|
|
|
|
2022-02-02 00:07:06 -07:00
|
|
|
let eventIndexCounter = 0;
|
2022-02-01 20:39:23 -07:00
|
|
|
const fragmentIdComparer = new FragmentIdComparer([]);
|
2022-02-07 18:55:11 -07:00
|
|
|
function makeEventEntryFromEventJson(eventJson, memberEvent) {
|
|
|
|
assert(eventJson);
|
2022-02-02 00:07:06 -07:00
|
|
|
|
|
|
|
const eventIndex = eventIndexCounter;
|
2022-02-03 22:44:49 -07:00
|
|
|
const eventEntry = new EventEntry(
|
|
|
|
{
|
|
|
|
fragmentId: 0,
|
|
|
|
eventIndex: eventIndex, // TODO: What should this be?
|
2022-02-15 00:33:16 -07:00
|
|
|
roomId: roomData.id,
|
2022-02-03 22:44:49 -07:00
|
|
|
event: eventJson,
|
2022-02-10 00:42:02 -07:00
|
|
|
displayName: memberEvent && memberEvent.content && memberEvent.content.displayname,
|
|
|
|
avatarUrl: memberEvent && memberEvent.content && memberEvent.content.avatar_url,
|
2022-02-15 00:33:16 -07:00
|
|
|
key: encodeKey(roomData.id, 0, eventIndex),
|
|
|
|
eventIdKey: encodeEventIdKey(roomData.id, eventJson.event_id),
|
2022-02-03 22:44:49 -07:00
|
|
|
},
|
|
|
|
fragmentIdComparer
|
|
|
|
);
|
2022-02-01 20:39:23 -07:00
|
|
|
|
2022-02-02 00:07:06 -07:00
|
|
|
eventIndexCounter++;
|
|
|
|
|
2022-02-01 20:39:23 -07:00
|
|
|
return eventEntry;
|
|
|
|
}
|
|
|
|
|
2022-06-08 13:03:36 -06:00
|
|
|
// For any `<a href="">` (anchor with a blank href), instead of reloading the
|
|
|
|
// page just remove the hash. Also cleanup whenever the hash changes for
|
|
|
|
// whatever reason.
|
|
|
|
//
|
|
|
|
// For example, when closing the lightbox by clicking the close "x" icon, it
|
|
|
|
// would reload the page instead of SPA because `href=""` will cause a page
|
|
|
|
// navigation if we didn't have this code. Also cleanup whenever the hash is
|
|
|
|
// emptied out (like when pressing escape in the lightbox).
|
|
|
|
function supressBlankAnchorsReloadingThePage() {
|
|
|
|
const eventHandler = {
|
|
|
|
clearHash() {
|
|
|
|
// Cause a `hashchange` event to be fired
|
|
|
|
document.location.hash = '';
|
|
|
|
// Cleanup the leftover `#` left on the URL
|
|
|
|
window.history.replaceState(null, null, window.location.pathname);
|
|
|
|
},
|
|
|
|
handleEvent(e) {
|
|
|
|
// For any `<a href="">` (anchor with a blank href), instead of reloading
|
|
|
|
// the page just remove the hash.
|
2022-09-20 15:02:09 -06:00
|
|
|
if (e.type === 'click') {
|
|
|
|
// Traverse up the DOM and see whether the click is a child of an anchor element
|
|
|
|
let target = e.target;
|
|
|
|
while (
|
|
|
|
target &&
|
|
|
|
// We use `nodeName` here because it's compatible with any Element (HTML or SVG)
|
|
|
|
target.nodeName !== 'A'
|
|
|
|
) {
|
|
|
|
target = target.parentNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (target?.tagName?.toLowerCase() === 'a' && target?.getAttribute('href') === '') {
|
|
|
|
this.clearHash();
|
|
|
|
// Prevent the page navigation (reload)
|
|
|
|
e.preventDefault();
|
|
|
|
}
|
2022-06-08 13:03:36 -06:00
|
|
|
}
|
|
|
|
// Also cleanup whenever the hash is emptied out (like when pressing escape in the lightbox)
|
|
|
|
else if (e.type === 'hashchange' && document.location.hash === '') {
|
|
|
|
this.clearHash();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
document.addEventListener('click', eventHandler);
|
|
|
|
window.addEventListener('hashchange', eventHandler);
|
|
|
|
}
|
|
|
|
|
2022-02-16 22:08:18 -07:00
|
|
|
// eslint-disable-next-line max-statements
|
2022-02-04 00:54:12 -07:00
|
|
|
async function mountHydrogen() {
|
2022-09-15 19:41:55 -06:00
|
|
|
console.log('Mounting Hydrogen...');
|
|
|
|
console.time('Completed mounting Hydrogen');
|
2022-09-08 00:30:04 -06:00
|
|
|
const appElement = document.querySelector('#app');
|
2022-02-03 22:44:49 -07:00
|
|
|
|
2022-02-09 00:49:02 -07:00
|
|
|
const platformConfig = {};
|
2022-02-01 20:39:23 -07:00
|
|
|
const assetPaths = {};
|
2022-06-06 17:58:45 -06:00
|
|
|
const platform = new Platform({
|
2022-09-08 00:30:04 -06:00
|
|
|
container: appElement,
|
2022-06-06 17:58:45 -06:00
|
|
|
assetPaths,
|
|
|
|
config: platformConfig,
|
|
|
|
options: { development: true },
|
|
|
|
});
|
2022-02-01 20:39:23 -07:00
|
|
|
|
2022-02-16 18:58:32 -07:00
|
|
|
const navigation = createNavigation();
|
|
|
|
platform.setNavigation(navigation);
|
2022-06-08 13:03:36 -06:00
|
|
|
|
|
|
|
const archiveHistory = new ArchiveHistory(roomData.id);
|
2022-02-16 18:58:32 -07:00
|
|
|
const urlRouter = createRouter({
|
|
|
|
navigation: navigation,
|
2022-06-08 13:03:36 -06:00
|
|
|
// We use our own history because we want the hash to be relative to the
|
|
|
|
// room and not include the session/room.
|
|
|
|
//
|
|
|
|
// Normally, people use `history: platform.history,`
|
|
|
|
history: archiveHistory,
|
2022-02-16 18:58:32 -07:00
|
|
|
});
|
2022-06-08 13:03:36 -06:00
|
|
|
// Make it listen to changes from the history instance. And populate the
|
|
|
|
// `Navigation` with path segments to work from so `href`'s rendered on the
|
|
|
|
// page don't say `undefined`.
|
|
|
|
urlRouter.attach();
|
2022-02-16 18:58:32 -07:00
|
|
|
|
2022-02-09 00:49:02 -07:00
|
|
|
// We use the timeline to setup the relations between entries
|
2022-02-02 00:07:06 -07:00
|
|
|
const timeline = new Timeline({
|
2022-02-15 00:33:16 -07:00
|
|
|
roomId: roomData.id,
|
2022-02-03 22:44:49 -07:00
|
|
|
fragmentIdComparer: fragmentIdComparer,
|
|
|
|
clock: platform.clock,
|
|
|
|
logger: platform.logger,
|
2022-02-02 00:07:06 -07:00
|
|
|
});
|
|
|
|
|
2022-02-10 00:42:02 -07:00
|
|
|
const mediaRepository = new MediaRepository({
|
|
|
|
homeserver: config.matrixServerUrl,
|
|
|
|
});
|
|
|
|
|
2022-02-16 13:56:20 -07:00
|
|
|
const room = {
|
|
|
|
name: roomData.name,
|
|
|
|
id: roomData.id,
|
|
|
|
avatarUrl: roomData.avatarUrl,
|
|
|
|
avatarColorId: roomData.id,
|
|
|
|
mediaRepository: mediaRepository,
|
2022-08-30 22:40:07 -06:00
|
|
|
// Based on https://github.com/vector-im/hydrogen-web/blob/5f9cfffa3b547991b665f57a8bf715270a1b2ef1/src/matrix/room/BaseRoom.js#L480
|
|
|
|
observePowerLevels: async function () {
|
|
|
|
let powerLevelsObservable = this._powerLevelsObservable;
|
|
|
|
if (!powerLevelsObservable) {
|
|
|
|
const powerLevels = new PowerLevels({
|
|
|
|
powerLevelEvent: {},
|
|
|
|
ownUserId: 'xxx-ownUserId',
|
|
|
|
membership: null,
|
|
|
|
});
|
|
|
|
powerLevelsObservable = new RetainedObservableValue(powerLevels, () => {
|
|
|
|
this._powerLevels = null;
|
|
|
|
});
|
|
|
|
this._powerLevelsObservable = powerLevelsObservable;
|
|
|
|
}
|
|
|
|
return powerLevelsObservable;
|
|
|
|
},
|
2022-02-16 13:56:20 -07:00
|
|
|
};
|
|
|
|
|
2022-02-09 01:07:16 -07:00
|
|
|
// Something we can modify with new state updates as we see them
|
|
|
|
const workingStateEventMap = {
|
|
|
|
...stateEventMap,
|
|
|
|
};
|
2022-09-20 15:02:09 -06:00
|
|
|
|
|
|
|
// Add a summary item to the bottom of the timeline that explains if we found
|
|
|
|
// events on the day requested.
|
|
|
|
const hasEventsFromGivenDay = events[events.length - 1]?.origin_server_ts >= fromTimestamp;
|
|
|
|
let daySummaryKind;
|
|
|
|
if (events.length === 0) {
|
|
|
|
daySummaryKind = 'no-events-at-all';
|
|
|
|
} else if (hasEventsFromGivenDay) {
|
|
|
|
daySummaryKind = 'some-events-in-day';
|
|
|
|
} else if (!hasEventsFromGivenDay) {
|
|
|
|
daySummaryKind = 'no-events-in-day';
|
|
|
|
}
|
|
|
|
events.push({
|
|
|
|
event_id: getFakeEventId(),
|
|
|
|
type: 'org.matrix.archive.not_enough_events_from_day_summary',
|
|
|
|
room_id: roomData.id,
|
|
|
|
// Even though this isn't used for sort, just using the time where the event
|
|
|
|
// would logically be.
|
|
|
|
//
|
|
|
|
// -1 so we're not at 00:00:00 of the next day
|
|
|
|
origin_server_ts: toTimestamp - 1,
|
|
|
|
content: {
|
|
|
|
daySummaryKind: daySummaryKind,
|
|
|
|
// The timestamp from the URL that was originally visited
|
|
|
|
dayTimestamp: fromTimestamp,
|
|
|
|
// The end of the range to use as a jumping off point to the next activity
|
|
|
|
rangeEndTimestamp: toTimestamp,
|
|
|
|
// This is a bit cheating but I don't know how else to pass this kind of
|
|
|
|
// info to the Tile viewmodel
|
|
|
|
basePath: config.basePath,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2022-02-07 18:55:11 -07:00
|
|
|
const eventEntries = events.map((event) => {
|
2022-02-09 01:07:16 -07:00
|
|
|
if (event.type === 'm.room.member') {
|
|
|
|
workingStateEventMap[event.state_key] = event;
|
|
|
|
}
|
|
|
|
|
|
|
|
const memberEvent = workingStateEventMap[event.user_id];
|
2022-02-07 18:55:11 -07:00
|
|
|
return makeEventEntryFromEventJson(event, memberEvent);
|
2022-02-01 20:39:23 -07:00
|
|
|
});
|
2022-06-09 19:44:57 -06:00
|
|
|
//console.log('eventEntries', eventEntries.length);
|
2022-02-01 21:32:59 -07:00
|
|
|
|
2022-06-08 13:03:36 -06:00
|
|
|
// Map of `event_id` to `EventEntry`
|
|
|
|
const eventEntriesByEventId = eventEntries.reduce((currentMap, eventEntry) => {
|
|
|
|
currentMap[eventEntry.id] = eventEntry;
|
|
|
|
return currentMap;
|
|
|
|
}, {});
|
|
|
|
|
2022-02-02 00:07:06 -07:00
|
|
|
// We have to use `timeline._setupEntries([])` because it sets
|
|
|
|
// `this._allEntries` in `Timeline` and we don't want to use `timeline.load()`
|
|
|
|
// to request remote things.
|
|
|
|
timeline._setupEntries([]);
|
|
|
|
// Make it safe to iterate a derived observable collection
|
|
|
|
timeline.entries.subscribe({ onAdd: () => null, onUpdate: () => null });
|
2022-02-09 00:49:02 -07:00
|
|
|
// We use the timeline to setup the relations between entries
|
2022-02-02 00:07:06 -07:00
|
|
|
timeline.addEntries(eventEntries);
|
|
|
|
|
2022-02-04 00:24:31 -07:00
|
|
|
//console.log('timeline.entries', timeline.entries.length, timeline.entries);
|
2022-02-02 00:07:06 -07:00
|
|
|
|
2022-06-06 17:58:45 -06:00
|
|
|
const tiles = new TilesCollection(timeline.entries, {
|
2022-09-20 15:02:09 -06:00
|
|
|
tileClassForEntry: customTileClassForEntry,
|
2022-06-06 17:58:45 -06:00
|
|
|
platform,
|
|
|
|
navigation,
|
|
|
|
urlCreator: urlRouter,
|
|
|
|
timeline,
|
|
|
|
roomVM: {
|
|
|
|
room,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
// Trigger `onSubscribeFirst` -> `tiles._populateTiles()` so it creates a tile
|
|
|
|
// for each entry to display. This way we can also call `tile.notifyVisible()`
|
|
|
|
// on each tile so that the tile creation doesn't happen later when the
|
|
|
|
// `TilesListView` is mounted and subscribes which is a bit out of our
|
|
|
|
// control.
|
2022-02-02 00:07:06 -07:00
|
|
|
tiles.subscribe({ onAdd: () => null, onUpdate: () => null });
|
2022-02-01 21:32:59 -07:00
|
|
|
|
2022-02-01 22:45:09 -07:00
|
|
|
// Make the lazy-load images appear
|
2022-02-03 22:44:49 -07:00
|
|
|
for (const tile of tiles) {
|
2022-02-01 22:45:09 -07:00
|
|
|
tile.notifyVisible();
|
2022-02-02 00:07:06 -07:00
|
|
|
}
|
2022-02-01 20:39:23 -07:00
|
|
|
|
|
|
|
const timelineViewModel = {
|
|
|
|
showJumpDown: false,
|
|
|
|
setVisibleTileRange: () => {},
|
2022-06-06 17:58:45 -06:00
|
|
|
tiles,
|
2022-02-01 20:39:23 -07:00
|
|
|
};
|
|
|
|
|
2022-02-10 00:42:02 -07:00
|
|
|
const roomViewModel = new RoomViewModel({
|
|
|
|
room,
|
2022-08-30 18:10:57 -06:00
|
|
|
// This is an arbitrary string (doesn't need to match anything and it shouldn't)
|
|
|
|
ownUserId: 'xxx-ownUserId',
|
2022-02-10 00:42:02 -07:00
|
|
|
platform,
|
2022-02-16 18:58:32 -07:00
|
|
|
urlCreator: urlRouter,
|
2022-02-10 00:42:02 -07:00
|
|
|
navigation,
|
|
|
|
});
|
|
|
|
|
2022-08-30 17:47:03 -06:00
|
|
|
roomViewModel.openRightPanel = function () {
|
|
|
|
let path = this.navigation.path.until('room');
|
|
|
|
path = path.with(this.navigation.segment('right-panel', true));
|
|
|
|
path = path.with(this.navigation.segment('change-dates', true));
|
|
|
|
this.navigation.applyPath(path);
|
|
|
|
};
|
|
|
|
|
2022-09-20 15:02:09 -06:00
|
|
|
roomViewModel.roomDirectoryUrl = matrixPublicArchiveURLCreator.roomDirectoryUrl();
|
|
|
|
|
2022-08-30 23:16:14 -06:00
|
|
|
Object.defineProperty(roomViewModel, 'timelineViewModel', {
|
|
|
|
get() {
|
|
|
|
return timelineViewModel;
|
|
|
|
},
|
|
|
|
});
|
2022-02-10 00:42:02 -07:00
|
|
|
|
2022-09-20 15:02:09 -06:00
|
|
|
const archiveRoomViewModel = new ArchiveRoomViewModel({
|
2022-08-30 18:10:57 -06:00
|
|
|
// Hydrogen options
|
2022-06-08 13:03:36 -06:00
|
|
|
navigation: navigation,
|
|
|
|
urlCreator: urlRouter,
|
|
|
|
history: archiveHistory,
|
2022-08-30 18:10:57 -06:00
|
|
|
// Our options
|
|
|
|
roomViewModel,
|
|
|
|
room,
|
2022-09-20 15:02:09 -06:00
|
|
|
fromDate: new Date(fromTimestamp),
|
2022-08-30 18:10:57 -06:00
|
|
|
eventEntriesByEventId,
|
2022-09-20 15:02:09 -06:00
|
|
|
shouldIndex,
|
2022-08-30 18:10:57 -06:00
|
|
|
basePath: config.basePath,
|
2022-06-08 13:03:36 -06:00
|
|
|
});
|
2022-02-10 01:21:49 -07:00
|
|
|
|
2022-09-20 15:02:09 -06:00
|
|
|
// Create a custom disabled composer view that shows our archive message.
|
|
|
|
class DisabledArchiveComposerViewModel extends ViewModel {
|
|
|
|
constructor(options) {
|
|
|
|
super(options);
|
|
|
|
|
|
|
|
// Whenever the `archiveRoomViewModel.currentTopPositionEventEntry`
|
|
|
|
// changes, re-render the composer view with the updated date.
|
|
|
|
archiveRoomViewModel.on('change', (changedProps) => {
|
|
|
|
if (changedProps === 'currentTopPositionEventEntry') {
|
|
|
|
this.emitChange();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
get kind() {
|
|
|
|
return 'disabled';
|
|
|
|
}
|
|
|
|
|
|
|
|
get description() {
|
|
|
|
return [
|
|
|
|
(/*vm*/) => {
|
|
|
|
const activeDate = new Date(
|
|
|
|
// If the date from our `archiveRoomViewModel` is available, use that
|
|
|
|
archiveRoomViewModel?.currentTopPositionEventEntry?.timestamp ||
|
|
|
|
// Otherwise, use our initial `fromTimestamp`
|
|
|
|
fromTimestamp
|
|
|
|
);
|
|
|
|
const dateString = activeDate.toISOString().split('T')[0];
|
|
|
|
return `You're viewing an archive of events from ${dateString}. Use a `;
|
|
|
|
},
|
|
|
|
tag.a(
|
|
|
|
{
|
|
|
|
href: matrixPublicArchiveURLCreator.permalinkForRoomId(roomData.id),
|
|
|
|
rel: 'noopener',
|
|
|
|
target: '_blank',
|
|
|
|
},
|
|
|
|
['Matrix client']
|
|
|
|
),
|
|
|
|
` to start chatting in this room.`,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const disabledArchiveComposerViewModel = new DisabledArchiveComposerViewModel({});
|
|
|
|
Object.defineProperty(roomViewModel, 'composerViewModel', {
|
|
|
|
get() {
|
|
|
|
return disabledArchiveComposerViewModel;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// ---------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------
|
2022-02-01 20:39:23 -07:00
|
|
|
|
2022-09-20 15:02:09 -06:00
|
|
|
// Render what we actually care about
|
|
|
|
const view = new ArchiveRoomView(archiveRoomViewModel);
|
2022-09-08 00:30:04 -06:00
|
|
|
appElement.replaceChildren(view.mount());
|
2022-02-17 19:40:48 -07:00
|
|
|
|
|
|
|
addSupportClasses();
|
2022-06-08 13:03:36 -06:00
|
|
|
supressBlankAnchorsReloadingThePage();
|
2022-09-15 19:41:55 -06:00
|
|
|
|
|
|
|
console.timeEnd('Completed mounting Hydrogen');
|
2022-02-01 20:39:23 -07:00
|
|
|
}
|
|
|
|
|
2022-06-08 13:03:36 -06:00
|
|
|
// N.B.: When we run this in a virtual machine (`vm`), it will return the last
|
|
|
|
// statement. It's important to leave this as the last statement so we can await
|
|
|
|
// the promise it returns and signal that all of the async tasks completed.
|
2022-02-04 00:54:12 -07:00
|
|
|
mountHydrogen();
|