set pointer to global data
This commit is contained in:
parent
cfdeacd071
commit
90f6bce64b
1 changed files with 5 additions and 7 deletions
|
@ -3,7 +3,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Import modules.
|
// Import modules.
|
||||||
import {session, observe} from "/scripts/secretariat.js";
|
import {session, global, observe} from "/scripts/secretariat.js";
|
||||||
|
import pointer from "/scripts/data/pointer.js";
|
||||||
import Window from "/scripts/GUI/window.js";
|
import Window from "/scripts/GUI/window.js";
|
||||||
import Page from "/scripts/pages/page.js";
|
import Page from "/scripts/pages/page.js";
|
||||||
import Loader from "/scripts/GUI/loader.js";
|
import Loader from "/scripts/GUI/loader.js";
|
||||||
|
@ -32,13 +33,10 @@ class Page_Popup extends Page {
|
||||||
*/
|
*/
|
||||||
async update(override = false) {
|
async update(override = false) {
|
||||||
// Set the reference website when overriding or unset.
|
// Set the reference website when overriding or unset.
|
||||||
(override || !this[`ref`]) ? this[`ref`] = await session.read([`last`, `URL`]) : false;
|
(override || !this[`ref`]) ? this[`ref`] = await global.read([`last`]) : false;
|
||||||
|
|
||||||
// Update all other data.
|
// Update all other data.
|
||||||
(this[`ref`]) ? this[`data`] = await session.read([`last`]) : false;
|
(this[`ref`]) ? this[`data`] = await global.read([`sites`, this[`ref`]]) : false;
|
||||||
|
|
||||||
// Merge objects
|
|
||||||
(this[`data`] && this[`ref`]) ? this[`data`] = Object.assign(this[`data`], await session.read([`sites`, this[`ref`]])) : false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async loading() {
|
async loading() {
|
||||||
|
@ -54,7 +52,7 @@ class Page_Popup extends Page {
|
||||||
|
|
||||||
// Prepare all the necessary data.
|
// Prepare all the necessary data.
|
||||||
await this.update();
|
await this.update();
|
||||||
|
|
||||||
// Make sure that the website has been selected!
|
// Make sure that the website has been selected!
|
||||||
if (this[`ref`]) {
|
if (this[`ref`]) {
|
||||||
// Set the relative chrome URLs
|
// Set the relative chrome URLs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue