chore: upgrade deps
This commit is contained in:
@@ -78,7 +78,7 @@ export abstract class PureComponent<
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onAppStateEvent(eventName: any, data: any) {
|
onAppStateEvent(_eventName: any, _data: any) {
|
||||||
/** Optional override */
|
/** Optional override */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export const AttachedFilesPopover: FunctionComponent<Props> = observer(
|
|||||||
);
|
);
|
||||||
|
|
||||||
setAllFiles(
|
setAllFiles(
|
||||||
application
|
application.items
|
||||||
.getItems(ContentType.File)
|
.getItems(ContentType.File)
|
||||||
.sort((a, b) =>
|
.sort((a, b) =>
|
||||||
a.created_at < b.created_at ? 1 : -1
|
a.created_at < b.created_at ? 1 : -1
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
import { FunctionComponent } from 'preact';
|
|
||||||
|
|
||||||
export const CircleProgress: FunctionComponent<{
|
|
||||||
percent: number;
|
|
||||||
className?: string;
|
|
||||||
}> = ({ percent, className = '' }) => {
|
|
||||||
const size = 16;
|
|
||||||
const ratioStrokeRadius = 0.25;
|
|
||||||
const outerRadius = size / 2;
|
|
||||||
|
|
||||||
const radius = outerRadius * (1 - ratioStrokeRadius);
|
|
||||||
const stroke = outerRadius - radius;
|
|
||||||
|
|
||||||
const circumference = radius * 2 * Math.PI;
|
|
||||||
const offset = circumference - (percent / 100) * circumference;
|
|
||||||
|
|
||||||
const transition = `transition: 0.35s stroke-dashoffset;`;
|
|
||||||
const transform = `transform: rotate(-90deg);`;
|
|
||||||
const transformOrigin = `transform-origin: 50% 50%;`;
|
|
||||||
const dasharray = `stroke-dasharray: ${circumference} ${circumference};`;
|
|
||||||
const dashoffset = `stroke-dashoffset: ${offset};`;
|
|
||||||
const style = `${transition} ${transform} ${transformOrigin} ${dasharray} ${dashoffset}`;
|
|
||||||
return (
|
|
||||||
<div className="h-5 w-5 min-w-5 min-h-5">
|
|
||||||
<svg viewBox={`0 0 ${size} ${size}`}>
|
|
||||||
<circle
|
|
||||||
stroke="#086DD6"
|
|
||||||
stroke-width={stroke}
|
|
||||||
fill="transparent"
|
|
||||||
r={radius}
|
|
||||||
cx="50%"
|
|
||||||
cy="50%"
|
|
||||||
style={style}
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { FunctionalComponent } from 'preact';
|
|
||||||
import { useEffect, useState } from 'preact/hooks';
|
|
||||||
import { CircleProgress } from './CircleProgress';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Circular progress bar which runs in a specified time interval
|
|
||||||
* @param time - time interval in ms
|
|
||||||
*/
|
|
||||||
export const CircleProgressTime: FunctionalComponent<{ time: number }> = ({
|
|
||||||
time,
|
|
||||||
}) => {
|
|
||||||
const [percent, setPercent] = useState(0);
|
|
||||||
const interval = time / 100;
|
|
||||||
useEffect(() => {
|
|
||||||
const tick = setInterval(() => {
|
|
||||||
if (percent === 100) {
|
|
||||||
setPercent(0);
|
|
||||||
} else {
|
|
||||||
setPercent(percent + 1);
|
|
||||||
}
|
|
||||||
}, interval);
|
|
||||||
return () => {
|
|
||||||
clearInterval(tick);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
return <CircleProgress percent={percent} />;
|
|
||||||
};
|
|
||||||
@@ -212,7 +212,10 @@ export class Footer extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
if (!this.didCheckForOffline) {
|
if (!this.didCheckForOffline) {
|
||||||
this.didCheckForOffline = true;
|
this.didCheckForOffline = true;
|
||||||
if (this.state.offline && this.application.getNoteCount() === 0) {
|
if (
|
||||||
|
this.state.offline &&
|
||||||
|
this.application.items.getNoteCount() === 0
|
||||||
|
) {
|
||||||
this.appState.accountMenu.setShow(true);
|
this.appState.accountMenu.setShow(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -244,7 +247,7 @@ export class Footer extends PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
streamItems() {
|
streamItems() {
|
||||||
this.application.setDisplayOptions(
|
this.application.items.setDisplayOptions(
|
||||||
ContentType.Theme,
|
ContentType.Theme,
|
||||||
CollectionSort.Title,
|
CollectionSort.Title,
|
||||||
'asc',
|
'asc',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { WebApplication } from '@/ui_models/application';
|
|||||||
import { CollectionSort, PrefKey } from '@standardnotes/snjs';
|
import { CollectionSort, PrefKey } from '@standardnotes/snjs';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { FunctionComponent } from 'preact';
|
import { FunctionComponent } from 'preact';
|
||||||
import { useRef, useState } from 'preact/hooks';
|
import { useState } from 'preact/hooks';
|
||||||
import { Icon } from './Icon';
|
import { Icon } from './Icon';
|
||||||
import { Menu } from './Menu/Menu';
|
import { Menu } from './Menu/Menu';
|
||||||
import { MenuItem, MenuItemSeparator, MenuItemType } from './Menu/MenuItem';
|
import { MenuItem, MenuItemSeparator, MenuItemType } from './Menu/MenuItem';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { useRef, useState } from 'preact/hooks';
|
import { useRef } from 'preact/hooks';
|
||||||
import {
|
import {
|
||||||
AlertDialog,
|
AlertDialog,
|
||||||
AlertDialogDescription,
|
AlertDialogDescription,
|
||||||
@@ -7,7 +7,6 @@ import {
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { AppState } from '@/ui_models/app_state';
|
import { AppState } from '@/ui_models/app_state';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
import { FunctionComponent } from 'preact';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
application: WebApplication;
|
application: WebApplication;
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export class PreferencesMenu {
|
|||||||
FeatureIdentifier.CloudLink,
|
FeatureIdentifier.CloudLink,
|
||||||
];
|
];
|
||||||
this._extensionPanes = (
|
this._extensionPanes = (
|
||||||
this.application.getItems([
|
this.application.items.getItems([
|
||||||
ContentType.ActionsExtension,
|
ContentType.ActionsExtension,
|
||||||
ContentType.Component,
|
ContentType.Component,
|
||||||
ContentType.Theme,
|
ContentType.Theme,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const Appearance: FunctionComponent<Props> = observer(
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const themesAsItems: DropdownItem[] = (
|
const themesAsItems: DropdownItem[] = (
|
||||||
application.getDisplayableItems(ContentType.Theme) as SNTheme[]
|
application.items.getDisplayableItems(ContentType.Theme) as SNTheme[]
|
||||||
)
|
)
|
||||||
.filter((theme) => !theme.isLayerable())
|
.filter((theme) => !theme.isLayerable())
|
||||||
.sort(sortThemes)
|
.sort(sortThemes)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import { useEffect, useRef, useState } from 'preact/hooks';
|
|||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
|
|
||||||
const loadExtensions = (application: WebApplication) =>
|
const loadExtensions = (application: WebApplication) =>
|
||||||
application.getItems(
|
application.items.getItems(
|
||||||
[ContentType.ActionsExtension, ContentType.Component, ContentType.Theme],
|
[ContentType.ActionsExtension, ContentType.Component, ContentType.Theme],
|
||||||
true
|
true
|
||||||
) as SNComponent[];
|
) as SNComponent[];
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
|
|||||||
|
|
||||||
const reloadThemes = useCallback(() => {
|
const reloadThemes = useCallback(() => {
|
||||||
const themes = (
|
const themes = (
|
||||||
application.getDisplayableItems(ContentType.Theme) as SNTheme[]
|
application.items.getDisplayableItems(ContentType.Theme) as SNTheme[]
|
||||||
).map((item) => {
|
).map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
@@ -141,7 +141,9 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
|
|||||||
|
|
||||||
const reloadToggleableComponents = useCallback(() => {
|
const reloadToggleableComponents = useCallback(() => {
|
||||||
const toggleableComponents = (
|
const toggleableComponents = (
|
||||||
application.getDisplayableItems(ContentType.Component) as SNComponent[]
|
application.items.getDisplayableItems(
|
||||||
|
ContentType.Component
|
||||||
|
) as SNComponent[]
|
||||||
).filter(
|
).filter(
|
||||||
(component) =>
|
(component) =>
|
||||||
[ComponentArea.EditorStack, ComponentArea.TagsList].includes(
|
[ComponentArea.EditorStack, ComponentArea.TagsList].includes(
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
|
|||||||
|
|
||||||
const restore = () => {
|
const restore = () => {
|
||||||
if (selectedRevision) {
|
if (selectedRevision) {
|
||||||
const originalNote = application.findItem(
|
const originalNote = application.items.findItem(
|
||||||
selectedRevision.payload.uuid
|
selectedRevision.payload.uuid
|
||||||
) as SNNote;
|
) as SNNote;
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
|
|||||||
|
|
||||||
const restoreAsCopy = async () => {
|
const restoreAsCopy = async () => {
|
||||||
if (selectedRevision) {
|
if (selectedRevision) {
|
||||||
const originalNote = application.findItem(
|
const originalNote = application.items.findItem(
|
||||||
selectedRevision.payload.uuid
|
selectedRevision.payload.uuid
|
||||||
) as SNNote;
|
) as SNNote;
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ export class RevisionPreviewModal extends PureComponent<Props, State> {
|
|||||||
this.props.content
|
this.props.content
|
||||||
)) as SNNote;
|
)) as SNNote;
|
||||||
|
|
||||||
this.originalNote = this.application.findItem(this.props.uuid) as SNNote;
|
this.originalNote = this.application.items.findItem(
|
||||||
|
this.props.uuid
|
||||||
|
) as SNNote;
|
||||||
|
|
||||||
const component = this.application.componentManager.editorForNote(
|
const component = this.application.componentManager.editorForNote(
|
||||||
this.originalNote
|
this.originalNote
|
||||||
|
|||||||
@@ -16,7 +16,9 @@ export const TagsSection: FunctionComponent<Props> = observer(
|
|||||||
const [hasMigration, setHasMigration] = useState<boolean>(false);
|
const [hasMigration, setHasMigration] = useState<boolean>(false);
|
||||||
|
|
||||||
const checkIfMigrationNeeded = useCallback(() => {
|
const checkIfMigrationNeeded = useCallback(() => {
|
||||||
setHasMigration(appState.application.hasTagsNeedingFoldersMigration());
|
setHasMigration(
|
||||||
|
appState.application.items.hasTagsNeedingFoldersMigration()
|
||||||
|
);
|
||||||
}, [appState.application]);
|
}, [appState.application]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNAlertService } from "@standardnotes/snjs";
|
import { SNAlertService } from '@standardnotes/snjs';
|
||||||
|
|
||||||
const STORE_NAME = 'items';
|
const STORE_NAME = 'items';
|
||||||
const READ_WRITE = 'readwrite';
|
const READ_WRITE = 'readwrite';
|
||||||
@@ -16,14 +16,13 @@ const DB_DELETION_BLOCKED =
|
|||||||
const QUOTE_EXCEEDED_ERROR = 'QuotaExceededError';
|
const QUOTE_EXCEEDED_ERROR = 'QuotaExceededError';
|
||||||
|
|
||||||
export class Database {
|
export class Database {
|
||||||
private locked = true
|
private locked = true;
|
||||||
private db?: IDBDatabase
|
private db?: IDBDatabase;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public databaseName: string,
|
public databaseName: string,
|
||||||
private alertService: SNAlertService) {
|
private alertService: SNAlertService
|
||||||
|
) {}
|
||||||
}
|
|
||||||
|
|
||||||
public deinit() {
|
public deinit() {
|
||||||
(this.alertService as any) = undefined;
|
(this.alertService as any) = undefined;
|
||||||
@@ -43,7 +42,9 @@ export class Database {
|
|||||||
* as part of the open process. This can happen on new application sessions, or if the
|
* as part of the open process. This can happen on new application sessions, or if the
|
||||||
* browser deleted the database without the user being aware.
|
* browser deleted the database without the user being aware.
|
||||||
*/
|
*/
|
||||||
public async openDatabase(onNewDatabase?: () => void): Promise<IDBDatabase | undefined> {
|
public async openDatabase(
|
||||||
|
onNewDatabase?: () => void
|
||||||
|
): Promise<IDBDatabase | undefined> {
|
||||||
if (this.locked) {
|
if (this.locked) {
|
||||||
throw Error('Attempting to open locked database');
|
throw Error('Attempting to open locked database');
|
||||||
}
|
}
|
||||||
@@ -84,15 +85,10 @@ export class Database {
|
|||||||
db.close();
|
db.close();
|
||||||
};
|
};
|
||||||
/* Create an objectStore for this database */
|
/* Create an objectStore for this database */
|
||||||
const objectStore = db.createObjectStore(
|
const objectStore = db.createObjectStore(STORE_NAME, {
|
||||||
STORE_NAME,
|
keyPath: 'uuid',
|
||||||
{ keyPath: 'uuid' }
|
});
|
||||||
);
|
objectStore.createIndex('uuid', 'uuid', { unique: true });
|
||||||
objectStore.createIndex(
|
|
||||||
'uuid',
|
|
||||||
'uuid',
|
|
||||||
{ unique: true }
|
|
||||||
);
|
|
||||||
objectStore.transaction.oncomplete = () => {
|
objectStore.transaction.oncomplete = () => {
|
||||||
/* Ready to store values in the newly created objectStore. */
|
/* Ready to store values in the newly created objectStore. */
|
||||||
if (db.version === 1 && onNewDatabase) {
|
if (db.version === 1 && onNewDatabase) {
|
||||||
@@ -106,9 +102,7 @@ export class Database {
|
|||||||
public async getAllPayloads(): Promise<any[]> {
|
public async getAllPayloads(): Promise<any[]> {
|
||||||
const db = (await this.openDatabase())!;
|
const db = (await this.openDatabase())!;
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
const objectStore =
|
const objectStore = db.transaction(STORE_NAME).objectStore(STORE_NAME);
|
||||||
db.transaction(STORE_NAME).
|
|
||||||
objectStore(STORE_NAME);
|
|
||||||
const payloads: any = [];
|
const payloads: any = [];
|
||||||
const cursorRequest = objectStore.openCursor();
|
const cursorRequest = objectStore.openCursor();
|
||||||
cursorRequest.onsuccess = (event) => {
|
cursorRequest.onsuccess = (event) => {
|
||||||
@@ -136,7 +130,7 @@ export class Database {
|
|||||||
const transaction = db.transaction(STORE_NAME, READ_WRITE);
|
const transaction = db.transaction(STORE_NAME, READ_WRITE);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
transaction.oncomplete = () => { };
|
transaction.oncomplete = () => {};
|
||||||
transaction.onerror = (event) => {
|
transaction.onerror = (event) => {
|
||||||
const target = event!.target! as any;
|
const target = event!.target! as any;
|
||||||
this.showGenericError(target.error);
|
this.showGenericError(target.error);
|
||||||
@@ -156,23 +150,28 @@ export class Database {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private async putItems(objectStore: IDBObjectStore, items: any[]): Promise<void> {
|
private async putItems(
|
||||||
await Promise.all(items.map((item) => {
|
objectStore: IDBObjectStore,
|
||||||
return new Promise((resolve) => {
|
items: any[]
|
||||||
const request = objectStore.put(item);
|
): Promise<void> {
|
||||||
request.onerror = resolve;
|
await Promise.all(
|
||||||
request.onsuccess = resolve;
|
items.map((item) => {
|
||||||
});
|
return new Promise((resolve) => {
|
||||||
}));
|
const request = objectStore.put(item);
|
||||||
|
request.onerror = resolve;
|
||||||
|
request.onsuccess = resolve;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deletePayload(uuid: string): Promise<void> {
|
public async deletePayload(uuid: string): Promise<void> {
|
||||||
const db = (await this.openDatabase())!;
|
const db = (await this.openDatabase())!;
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const request =
|
const request = db
|
||||||
db.transaction(STORE_NAME, READ_WRITE)
|
.transaction(STORE_NAME, READ_WRITE)
|
||||||
.objectStore(STORE_NAME)
|
.objectStore(STORE_NAME)
|
||||||
.delete(uuid);
|
.delete(uuid);
|
||||||
request.onsuccess = () => {
|
request.onsuccess = () => {
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
@@ -201,7 +200,7 @@ export class Database {
|
|||||||
this.alertService!.alert(message);
|
this.alertService!.alert(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
private showGenericError(error: { code: number, name: string }) {
|
private showGenericError(error: { code: number; name: string }) {
|
||||||
const message =
|
const message =
|
||||||
`Unable to save changes locally due to an unknown system issue. ` +
|
`Unable to save changes locally due to an unknown system issue. ` +
|
||||||
`Issue Code: ${error.code} Issue Name: ${error.name}.`;
|
`Issue Code: ${error.code} Issue Name: ${error.name}.`;
|
||||||
@@ -210,11 +209,11 @@ export class Database {
|
|||||||
|
|
||||||
private displayOfflineAlert() {
|
private displayOfflineAlert() {
|
||||||
const message =
|
const message =
|
||||||
"There was an issue loading your offline database. This could happen for two reasons:" +
|
'There was an issue loading your offline database. This could happen for two reasons:' +
|
||||||
"\n\n1. You're in a private window in your browser. We can't save your data without " +
|
"\n\n1. You're in a private window in your browser. We can't save your data without " +
|
||||||
"access to the local database. Please use a non-private window." +
|
'access to the local database. Please use a non-private window.' +
|
||||||
"\n\n2. You have two windows of the app open at the same time. " +
|
'\n\n2. You have two windows of the app open at the same time. ' +
|
||||||
"Please close any other app instances and reload the page.";
|
'Please close any other app instances and reload the page.';
|
||||||
this.alertService!.alert(message);
|
this.alertService!.alert(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export class DesktopManager
|
|||||||
componentData: any,
|
componentData: any,
|
||||||
error: any
|
error: any
|
||||||
) {
|
) {
|
||||||
const component = this.application.findItem(componentData.uuid);
|
const component = this.application.items.findItem(componentData.uuid);
|
||||||
if (!component) {
|
if (!component) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ export class ThemeManager extends ApplicationService {
|
|||||||
const preference = prefersDarkColorScheme
|
const preference = prefersDarkColorScheme
|
||||||
? PrefKey.AutoDarkThemeIdentifier
|
? PrefKey.AutoDarkThemeIdentifier
|
||||||
: PrefKey.AutoLightThemeIdentifier;
|
: PrefKey.AutoLightThemeIdentifier;
|
||||||
const themes = this.application.getDisplayableItems(
|
const themes = this.application.items.getDisplayableItems(
|
||||||
ContentType.Theme
|
ContentType.Theme
|
||||||
) as SNTheme[];
|
) as SNTheme[];
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ export class ThemeManager extends ApplicationService {
|
|||||||
private handleFeaturesUpdated(): void {
|
private handleFeaturesUpdated(): void {
|
||||||
let hasChange = false;
|
let hasChange = false;
|
||||||
for (const themeUuid of this.activeThemes) {
|
for (const themeUuid of this.activeThemes) {
|
||||||
const theme = this.application.findItem(themeUuid) as SNTheme;
|
const theme = this.application.items.findItem(themeUuid) as SNTheme;
|
||||||
if (!theme) {
|
if (!theme) {
|
||||||
this.deactivateTheme(themeUuid);
|
this.deactivateTheme(themeUuid);
|
||||||
hasChange = true;
|
hasChange = true;
|
||||||
@@ -143,7 +143,7 @@ export class ThemeManager extends ApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const activeThemes = (
|
const activeThemes = (
|
||||||
this.application.getItems(ContentType.Theme) as SNTheme[]
|
this.application.items.getItems(ContentType.Theme) as SNTheme[]
|
||||||
).filter((theme) => theme.active);
|
).filter((theme) => theme.active);
|
||||||
|
|
||||||
for (const theme of activeThemes) {
|
for (const theme of activeThemes) {
|
||||||
@@ -248,7 +248,9 @@ export class ThemeManager extends ApplicationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async cacheThemeState() {
|
private async cacheThemeState() {
|
||||||
const themes = this.application.getAll(this.activeThemes) as SNTheme[];
|
const themes = this.application.items.findItems(
|
||||||
|
this.activeThemes
|
||||||
|
) as SNTheme[];
|
||||||
const mapped = await Promise.all(
|
const mapped = await Promise.all(
|
||||||
themes.map(async (theme) => {
|
themes.map(async (theme) => {
|
||||||
const payload = theme.payloadRepresentation();
|
const payload = theme.payloadRepresentation();
|
||||||
@@ -275,8 +277,9 @@ export class ThemeManager extends ApplicationService {
|
|||||||
if (cachedThemes) {
|
if (cachedThemes) {
|
||||||
const themes = [];
|
const themes = [];
|
||||||
for (const cachedTheme of cachedThemes) {
|
for (const cachedTheme of cachedThemes) {
|
||||||
const payload = this.application.createPayloadFromObject(cachedTheme);
|
const payload =
|
||||||
const theme = this.application.createItemFromPayload(
|
this.application.items.createPayloadFromObject(cachedTheme);
|
||||||
|
const theme = this.application.items.createItemFromPayload(
|
||||||
payload
|
payload
|
||||||
) as SNTheme;
|
) as SNTheme;
|
||||||
themes.push(theme);
|
themes.push(theme);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export class AccountMenuState {
|
|||||||
this.appEventListeners.push(
|
this.appEventListeners.push(
|
||||||
this.application.streamItems([ContentType.Note, ContentType.Tag], () => {
|
this.application.streamItems([ContentType.Note, ContentType.Tag], () => {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.notesAndTags = this.application.getItems([
|
this.notesAndTags = this.application.items.getItems([
|
||||||
ContentType.Note,
|
ContentType.Note,
|
||||||
ContentType.Tag,
|
ContentType.Tag,
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ export class AppState {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.application.isTemplateItem(tag)) {
|
if (this.application.items.isTemplateItem(tag)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -436,9 +436,11 @@ export class AppState {
|
|||||||
|
|
||||||
/** Returns the tags that are referncing this note */
|
/** Returns the tags that are referncing this note */
|
||||||
public getNoteTags(note: SNNote) {
|
public getNoteTags(note: SNNote) {
|
||||||
return this.application.referencingForItem(note).filter((ref) => {
|
return this.application.items
|
||||||
return ref.content_type === ContentType.Tag;
|
.itemsReferencingItem(note.uuid)
|
||||||
}) as SNTag[];
|
.filter((ref) => {
|
||||||
|
return ref.content_type === ContentType.Tag;
|
||||||
|
}) as SNTag[];
|
||||||
}
|
}
|
||||||
|
|
||||||
panelDidResize(name: string, collapsed: boolean) {
|
panelDidResize(name: string, collapsed: boolean) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { storage, StorageKey } from "@/services/localStorage";
|
import { storage, StorageKey } from '@/services/localStorage';
|
||||||
import { SNApplication, ApplicationEvent } from "@standardnotes/snjs";
|
import { SNApplication, ApplicationEvent } from '@standardnotes/snjs';
|
||||||
import { runInAction, makeObservable, observable, action } from "mobx";
|
import { runInAction, makeObservable, observable, action } from 'mobx';
|
||||||
|
|
||||||
export class NoAccountWarningState {
|
export class NoAccountWarningState {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
@@ -33,9 +33,9 @@ export class NoAccountWarningState {
|
|||||||
hide = (): void => {
|
hide = (): void => {
|
||||||
this.show = false;
|
this.show = false;
|
||||||
storage.set(StorageKey.ShowNoAccountWarning, false);
|
storage.set(StorageKey.ShowNoAccountWarning, false);
|
||||||
}
|
};
|
||||||
|
|
||||||
reset = (): void => {
|
reset = (): void => {
|
||||||
storage.remove(StorageKey.ShowNoAccountWarning);
|
storage.remove(StorageKey.ShowNoAccountWarning);
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ export class NoteTagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
searchActiveNoteAutocompleteTags(): void {
|
searchActiveNoteAutocompleteTags(): void {
|
||||||
const newResults = this.application.searchTags(
|
const newResults = this.application.items.searchTags(
|
||||||
this.autocompleteSearchQuery,
|
this.autocompleteSearchQuery,
|
||||||
this.activeNote
|
this.activeNote
|
||||||
);
|
);
|
||||||
@@ -184,7 +184,7 @@ export class NoteTagsState {
|
|||||||
reloadTags(): void {
|
reloadTags(): void {
|
||||||
const { activeNote } = this;
|
const { activeNote } = this;
|
||||||
if (activeNote) {
|
if (activeNote) {
|
||||||
const tags = this.application.getSortedTagsForNote(activeNote);
|
const tags = this.application.items.getSortedTagsForNote(activeNote);
|
||||||
this.setTags(tags);
|
this.setTags(tags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,7 +224,7 @@ export class NoteTagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getSortedTagsForNote(note: SNNote): SNTag[] {
|
getSortedTagsForNote(note: SNNote): SNTag[] {
|
||||||
const tags = this.application.getSortedTagsForNote(note);
|
const tags = this.application.items.getSortedTagsForNote(note);
|
||||||
|
|
||||||
const sortFunction = (tagA: SNTag, tagB: SNTag): number => {
|
const sortFunction = (tagA: SNTag, tagB: SNTag): number => {
|
||||||
const a = this.getLongTitle(tagA);
|
const a = this.getLongTitle(tagA);
|
||||||
@@ -243,10 +243,10 @@ export class NoteTagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPrefixTitle(tag: SNTag): string | undefined {
|
getPrefixTitle(tag: SNTag): string | undefined {
|
||||||
return this.application.getTagPrefixTitle(tag);
|
return this.application.items.getTagPrefixTitle(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
getLongTitle(tag: SNTag): string {
|
getLongTitle(tag: SNTag): string {
|
||||||
return this.application.getTagLongTitle(tag);
|
return this.application.items.getTagLongTitle(tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ export class NotesState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get trashedNotesCount(): number {
|
get trashedNotesCount(): number {
|
||||||
return this.application.getTrashedItems().length;
|
return this.application.items.trashedItems.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async selectNotesRange(selectedNote: SNNote): Promise<void> {
|
private async selectNotesRange(selectedNote: SNNote): Promise<void> {
|
||||||
const notes = this.application.getDisplayableItems(
|
const notes = this.application.items.getDisplayableItems(
|
||||||
ContentType.Note
|
ContentType.Note
|
||||||
) as SNNote[];
|
) as SNNote[];
|
||||||
const lastSelectedNoteIndex = notes.findIndex(
|
const lastSelectedNoteIndex = notes.findIndex(
|
||||||
@@ -117,7 +117,7 @@ export class NotesState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async selectNote(uuid: UuidString, userTriggered?: boolean): Promise<void> {
|
async selectNote(uuid: UuidString, userTriggered?: boolean): Promise<void> {
|
||||||
const note = this.application.findItem(uuid) as SNNote;
|
const note = this.application.items.findItem(uuid) as SNNote;
|
||||||
if (!note) {
|
if (!note) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -163,7 +163,9 @@ export class NotesState {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const note = this.application.findItem(noteUuid) as SNNote | undefined;
|
const note = this.application.items.findItem(noteUuid) as
|
||||||
|
| SNNote
|
||||||
|
| undefined;
|
||||||
if (!note) {
|
if (!note) {
|
||||||
console.warn('Tried accessing a non-existant note of UUID ' + noteUuid);
|
console.warn('Tried accessing a non-existant note of UUID ' + noteUuid);
|
||||||
return;
|
return;
|
||||||
@@ -408,7 +410,7 @@ export class NotesState {
|
|||||||
|
|
||||||
async addTagToSelectedNotes(tag: SNTag): Promise<void> {
|
async addTagToSelectedNotes(tag: SNTag): Promise<void> {
|
||||||
const selectedNotes = Object.values(this.selectedNotes);
|
const selectedNotes = Object.values(this.selectedNotes);
|
||||||
const parentChainTags = this.application.getTagParentChain(tag);
|
const parentChainTags = this.application.items.getTagParentChain(tag.uuid);
|
||||||
const tagsToAdd = [...parentChainTags, tag];
|
const tagsToAdd = [...parentChainTags, tag];
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
tagsToAdd.map(async (tag) => {
|
tagsToAdd.map(async (tag) => {
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ export class NotesViewState {
|
|||||||
if (!tag) {
|
if (!tag) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const notes = this.application.getDisplayableItems(
|
const notes = this.application.items.getDisplayableItems(
|
||||||
ContentType.Note
|
ContentType.Note
|
||||||
) as SNNote[];
|
) as SNNote[];
|
||||||
const renderedNotes = notes.slice(0, this.notesToDisplay);
|
const renderedNotes = notes.slice(0, this.notesToDisplay);
|
||||||
@@ -264,7 +264,7 @@ export class NotesViewState {
|
|||||||
this.appState.searchOptions.includeProtectedContents,
|
this.appState.searchOptions.includeProtectedContents,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
this.application.setNotesDisplayCriteria(criteria);
|
this.application.items.setNotesDisplayCriteria(criteria);
|
||||||
};
|
};
|
||||||
|
|
||||||
reloadPreferences = () => {
|
reloadPreferences = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { SyncOpStatus } from "@standardnotes/snjs";
|
import { SyncOpStatus } from '@standardnotes/snjs';
|
||||||
import { action, makeObservable, observable } from "mobx";
|
import { action, makeObservable, observable } from 'mobx';
|
||||||
|
|
||||||
export class SyncState {
|
export class SyncState {
|
||||||
inProgress = false;
|
inProgress = false;
|
||||||
@@ -32,5 +32,5 @@ export class SyncState {
|
|||||||
{ style: 'percent' }
|
{ style: 'percent' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,9 +29,11 @@ import { FeaturesState, SMART_TAGS_FEATURE_NAME } from './features_state';
|
|||||||
type AnyTag = SNTag | SmartView;
|
type AnyTag = SNTag | SmartView;
|
||||||
|
|
||||||
const rootTags = (application: SNApplication): SNTag[] => {
|
const rootTags = (application: SNApplication): SNTag[] => {
|
||||||
const hasNoParent = (tag: SNTag) => !application.getTagParent(tag);
|
const hasNoParent = (tag: SNTag) => !application.items.getTagParent(tag.uuid);
|
||||||
|
|
||||||
const allTags = application.getDisplayableItems(ContentType.Tag) as SNTag[];
|
const allTags = application.items.getDisplayableItems(
|
||||||
|
ContentType.Tag
|
||||||
|
) as SNTag[];
|
||||||
const rootTags = allTags.filter(hasNoParent);
|
const rootTags = allTags.filter(hasNoParent);
|
||||||
|
|
||||||
return rootTags;
|
return rootTags;
|
||||||
@@ -41,11 +43,11 @@ const tagSiblings = (application: SNApplication, tag: SNTag): SNTag[] => {
|
|||||||
const withoutCurrentTag = (tags: SNTag[]) =>
|
const withoutCurrentTag = (tags: SNTag[]) =>
|
||||||
tags.filter((other) => other.uuid !== tag.uuid);
|
tags.filter((other) => other.uuid !== tag.uuid);
|
||||||
|
|
||||||
const isTemplateTag = application.isTemplateItem(tag);
|
const isTemplateTag = application.items.isTemplateItem(tag);
|
||||||
const parentTag = !isTemplateTag && application.getTagParent(tag);
|
const parentTag = !isTemplateTag && application.items.getTagParent(tag.uuid);
|
||||||
|
|
||||||
if (parentTag) {
|
if (parentTag) {
|
||||||
const siblingsAndTag = application.getTagChildren(parentTag);
|
const siblingsAndTag = application.items.getTagChildren(parentTag.uuid);
|
||||||
return withoutCurrentTag(siblingsAndTag);
|
return withoutCurrentTag(siblingsAndTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,7 +103,7 @@ export class TagsState {
|
|||||||
this.editing_ = undefined;
|
this.editing_ = undefined;
|
||||||
this.addingSubtagTo = undefined;
|
this.addingSubtagTo = undefined;
|
||||||
|
|
||||||
this.smartViews = this.application.getSmartViews();
|
this.smartViews = this.application.items.getSmartViews();
|
||||||
this.selected_ = this.smartViews[0];
|
this.selected_ = this.smartViews[0];
|
||||||
|
|
||||||
makeObservable(this, {
|
makeObservable(this, {
|
||||||
@@ -148,10 +150,10 @@ export class TagsState {
|
|||||||
[ContentType.Tag, ContentType.SmartView],
|
[ContentType.Tag, ContentType.SmartView],
|
||||||
(items) => {
|
(items) => {
|
||||||
runInAction(() => {
|
runInAction(() => {
|
||||||
this.tags = this.application.getDisplayableItems<SNTag>(
|
this.tags = this.application.items.getDisplayableItems<SNTag>(
|
||||||
ContentType.Tag
|
ContentType.Tag
|
||||||
);
|
);
|
||||||
this.smartViews = this.application.getSmartViews();
|
this.smartViews = this.application.items.getSmartViews();
|
||||||
|
|
||||||
const selectedTag = this.selected_;
|
const selectedTag = this.selected_;
|
||||||
if (selectedTag && !isSystemView(selectedTag as SmartView)) {
|
if (selectedTag && !isSystemView(selectedTag as SmartView)) {
|
||||||
@@ -174,12 +176,14 @@ export class TagsState {
|
|||||||
);
|
);
|
||||||
|
|
||||||
appEventListeners.push(
|
appEventListeners.push(
|
||||||
this.application.addNoteCountChangeObserver((tagUuid) => {
|
this.application.items.addNoteCountChangeObserver((tagUuid) => {
|
||||||
if (!tagUuid) {
|
if (!tagUuid) {
|
||||||
this.setAllNotesCount(this.application.allCountableNotesCount());
|
this.setAllNotesCount(
|
||||||
|
this.application.items.allCountableNotesCount()
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
this.tagsCountsState.update([
|
this.tagsCountsState.update([
|
||||||
this.application.findItem(tagUuid) as SNTag,
|
this.application.items.findItem(tagUuid) as SNTag,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -198,7 +202,7 @@ export class TagsState {
|
|||||||
title
|
title
|
||||||
)) as SNTag;
|
)) as SNTag;
|
||||||
|
|
||||||
const futureSiblings = this.application.getTagChildren(parent);
|
const futureSiblings = this.application.items.getTagChildren(parent.uuid);
|
||||||
|
|
||||||
if (!isValidFutureSiblings(this.application, futureSiblings, createdTag)) {
|
if (!isValidFutureSiblings(this.application, futureSiblings, createdTag)) {
|
||||||
this.setAddingSubtagTo(undefined);
|
this.setAddingSubtagTo(undefined);
|
||||||
@@ -299,7 +303,7 @@ export class TagsState {
|
|||||||
public get allLocalRootTags(): SNTag[] {
|
public get allLocalRootTags(): SNTag[] {
|
||||||
if (
|
if (
|
||||||
this.editing_ instanceof SNTag &&
|
this.editing_ instanceof SNTag &&
|
||||||
this.application.isTemplateItem(this.editing_)
|
this.application.items.isTemplateItem(this.editing_)
|
||||||
) {
|
) {
|
||||||
return [this.editing_, ...this.rootTags];
|
return [this.editing_, ...this.rootTags];
|
||||||
}
|
}
|
||||||
@@ -311,11 +315,11 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getChildren(tag: SNTag): SNTag[] {
|
getChildren(tag: SNTag): SNTag[] {
|
||||||
if (this.application.isTemplateItem(tag)) {
|
if (this.application.items.isTemplateItem(tag)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const children = this.application.getTagChildren(tag);
|
const children = this.application.items.getTagChildren(tag.uuid);
|
||||||
|
|
||||||
const childrenUuids = children.map((childTag) => childTag.uuid);
|
const childrenUuids = children.map((childTag) => childTag.uuid);
|
||||||
const childrenTags = this.tags.filter((tag) =>
|
const childrenTags = this.tags.filter((tag) =>
|
||||||
@@ -325,11 +329,11 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isValidTagParent(parentUuid: UuidString, tagUuid: UuidString): boolean {
|
isValidTagParent(parentUuid: UuidString, tagUuid: UuidString): boolean {
|
||||||
return this.application.isValidTagParent(parentUuid, tagUuid);
|
return this.application.items.isValidTagParent(parentUuid, tagUuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public hasParent(tagUuid: UuidString): boolean {
|
public hasParent(tagUuid: UuidString): boolean {
|
||||||
const item = this.application.findItem(tagUuid);
|
const item = this.application.items.findItem(tagUuid);
|
||||||
return !!item && !!(item as SNTag).parentId;
|
return !!item && !!(item as SNTag).parentId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -337,9 +341,9 @@ export class TagsState {
|
|||||||
tagUuid: string,
|
tagUuid: string,
|
||||||
futureParentUuid: string | undefined
|
futureParentUuid: string | undefined
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const tag = this.application.findItem(tagUuid) as SNTag;
|
const tag = this.application.items.findItem(tagUuid) as SNTag;
|
||||||
|
|
||||||
const currentParent = this.application.getTagParent(tag);
|
const currentParent = this.application.items.getTagParent(tag.uuid);
|
||||||
const currentParentUuid = currentParent?.uuid;
|
const currentParentUuid = currentParent?.uuid;
|
||||||
|
|
||||||
if (currentParentUuid === futureParentUuid) {
|
if (currentParentUuid === futureParentUuid) {
|
||||||
@@ -348,7 +352,7 @@ export class TagsState {
|
|||||||
|
|
||||||
const futureParent =
|
const futureParent =
|
||||||
futureParentUuid &&
|
futureParentUuid &&
|
||||||
(this.application.findItem(futureParentUuid) as SNTag);
|
(this.application.items.findItem(futureParentUuid) as SNTag);
|
||||||
|
|
||||||
if (!futureParent) {
|
if (!futureParent) {
|
||||||
const futureSiblings = rootTags(this.application);
|
const futureSiblings = rootTags(this.application);
|
||||||
@@ -357,7 +361,9 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
await this.application.mutator.unsetTagParent(tag);
|
await this.application.mutator.unsetTagParent(tag);
|
||||||
} else {
|
} else {
|
||||||
const futureSiblings = this.application.getTagChildren(futureParent);
|
const futureSiblings = this.application.items.getTagChildren(
|
||||||
|
futureParent.uuid
|
||||||
|
);
|
||||||
if (!isValidFutureSiblings(this.application, futureSiblings, tag)) {
|
if (!isValidFutureSiblings(this.application, futureSiblings, tag)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -368,7 +374,9 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get rootTags(): SNTag[] {
|
get rootTags(): SNTag[] {
|
||||||
return this.tags.filter((tag) => !this.application.getTagParent(tag));
|
return this.tags.filter(
|
||||||
|
(tag) => !this.application.items.getTagParent(tag.uuid)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
get tagsCount(): number {
|
get tagsCount(): number {
|
||||||
@@ -432,7 +440,7 @@ export class TagsState {
|
|||||||
|
|
||||||
public async createNewTemplate() {
|
public async createNewTemplate() {
|
||||||
const isAlreadyEditingATemplate =
|
const isAlreadyEditingATemplate =
|
||||||
this.editing_ && this.application.isTemplateItem(this.editing_);
|
this.editing_ && this.application.items.isTemplateItem(this.editing_);
|
||||||
|
|
||||||
if (isAlreadyEditingATemplate) {
|
if (isAlreadyEditingATemplate) {
|
||||||
return;
|
return;
|
||||||
@@ -470,7 +478,7 @@ export class TagsState {
|
|||||||
public async save(tag: SNTag | SmartView, newTitle: string) {
|
public async save(tag: SNTag | SmartView, newTitle: string) {
|
||||||
const hasEmptyTitle = newTitle.length === 0;
|
const hasEmptyTitle = newTitle.length === 0;
|
||||||
const hasNotChangedTitle = newTitle === tag.title;
|
const hasNotChangedTitle = newTitle === tag.title;
|
||||||
const isTemplateChange = this.application.isTemplateItem(tag);
|
const isTemplateChange = this.application.items.isTemplateItem(tag);
|
||||||
|
|
||||||
const siblings =
|
const siblings =
|
||||||
tag instanceof SNTag ? tagSiblings(this.application, tag) : [];
|
tag instanceof SNTag ? tagSiblings(this.application, tag) : [];
|
||||||
@@ -500,7 +508,8 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isTemplateChange) {
|
if (isTemplateChange) {
|
||||||
const isSmartViewTitle = this.application.isSmartViewTitle(newTitle);
|
const isSmartViewTitle =
|
||||||
|
this.application.items.isSmartViewTitle(newTitle);
|
||||||
|
|
||||||
if (isSmartViewTitle) {
|
if (isSmartViewTitle) {
|
||||||
if (!this.features.hasSmartViews) {
|
if (!this.features.hasSmartViews) {
|
||||||
@@ -541,7 +550,7 @@ export class TagsState {
|
|||||||
item.content_type === ContentType.Tag ||
|
item.content_type === ContentType.Tag ||
|
||||||
item.content_type === ContentType.SmartView
|
item.content_type === ContentType.SmartView
|
||||||
) {
|
) {
|
||||||
const matchingTag = this.application.findItem(item.uuid);
|
const matchingTag = this.application.items.findItem(item.uuid);
|
||||||
|
|
||||||
if (matchingTag) {
|
if (matchingTag) {
|
||||||
this.selected = matchingTag as AnyTag;
|
this.selected = matchingTag as AnyTag;
|
||||||
@@ -554,7 +563,9 @@ export class TagsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get hasAtLeastOneFolder(): boolean {
|
public get hasAtLeastOneFolder(): boolean {
|
||||||
return this.tags.some((tag) => !!this.application.getTagParent(tag));
|
return this.tags.some(
|
||||||
|
(tag) => !!this.application.items.getTagParent(tag.uuid)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -575,7 +586,7 @@ class TagsCountsState {
|
|||||||
);
|
);
|
||||||
|
|
||||||
tags.forEach((tag) => {
|
tags.forEach((tag) => {
|
||||||
newCounts[tag.uuid] = this.application.countableNotesForTag(tag);
|
newCounts[tag.uuid] = this.application.items.countableNotesForTag(tag);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.counts = newCounts;
|
this.counts = newCounts;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
"@standardnotes/filepicker": "1.10.1",
|
"@standardnotes/filepicker": "1.10.1",
|
||||||
"@standardnotes/settings": "1.13.1",
|
"@standardnotes/settings": "1.13.1",
|
||||||
"@standardnotes/sncrypto-web": "1.8.0",
|
"@standardnotes/sncrypto-web": "1.8.0",
|
||||||
"@standardnotes/snjs": "2.89.1",
|
"@standardnotes/snjs": "2.89.3",
|
||||||
"@zip.js/zip.js": "^2.4.7",
|
"@zip.js/zip.js": "^2.4.7",
|
||||||
"mobx": "^6.5.0",
|
"mobx": "^6.5.0",
|
||||||
"mobx-react-lite": "^3.3.0",
|
"mobx-react-lite": "^3.3.0",
|
||||||
|
|||||||
@@ -2484,10 +2484,10 @@
|
|||||||
buffer "^6.0.3"
|
buffer "^6.0.3"
|
||||||
libsodium-wrappers "^0.7.9"
|
libsodium-wrappers "^0.7.9"
|
||||||
|
|
||||||
"@standardnotes/snjs@2.89.1":
|
"@standardnotes/snjs@2.89.3":
|
||||||
version "2.89.1"
|
version "2.89.3"
|
||||||
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.89.1.tgz#73694f24e748d51abf72255c57545006c8882aec"
|
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.89.3.tgz#cdf4030772308df0572eb9de21dae3c03a96a906"
|
||||||
integrity sha512-KHwxyhCx4W+ba6QgqEEkIxxbm8D7O8BdIZFVbawPhMfvnp0rX7pd7EclqG8rOD2dTzb74cA7IHp2/MJsj3i0vw==
|
integrity sha512-UYiO9cNntlxB/0CkLPvWMNves8TUuANx2jliKlVbHbPjuECh0MDa5ZBPoSKFWrDE51oU41GqjUp05mr6FK7Skw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@standardnotes/applications" "^1.2.5"
|
"@standardnotes/applications" "^1.2.5"
|
||||||
"@standardnotes/auth" "^3.17.10"
|
"@standardnotes/auth" "^3.17.10"
|
||||||
|
|||||||
Reference in New Issue
Block a user