chore: upgrade deps
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
StreamingFileSaver,
|
||||
ClassicFileSaver,
|
||||
} from '@standardnotes/filepicker';
|
||||
import { SNFile } from '@standardnotes/snjs';
|
||||
import { ClientDisplayableError, SNFile } from '@standardnotes/snjs';
|
||||
import { addToast, dismissToast, ToastType } from '@standardnotes/stylekit';
|
||||
|
||||
import { WebApplication } from '../application';
|
||||
@@ -87,6 +87,15 @@ export class FilesState {
|
||||
for (const file of selectedFiles) {
|
||||
const operation = await this.application.files.beginNewFileUpload();
|
||||
|
||||
if (operation instanceof ClientDisplayableError) {
|
||||
addToast({
|
||||
type: ToastType.Error,
|
||||
message: `Unable to start upload session`,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const onChunk = async (
|
||||
chunk: Uint8Array,
|
||||
index: number,
|
||||
@@ -116,6 +125,15 @@ export class FilesState {
|
||||
{ name: fileResult.name, mimeType: fileResult.mimeType }
|
||||
);
|
||||
|
||||
if (uploadedFile instanceof ClientDisplayableError) {
|
||||
addToast({
|
||||
type: ToastType.Error,
|
||||
message: `Unable to close upload session`,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
uploadedFiles.push(uploadedFile);
|
||||
|
||||
dismissToast(toastId);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
ApplicationEvent,
|
||||
ClientDisplayableError,
|
||||
convertTimestampToMilliseconds,
|
||||
} from '@standardnotes/snjs';
|
||||
import { action, computed, makeObservable, observable } from 'mobx';
|
||||
@@ -99,7 +100,7 @@ export class SubscriptionState {
|
||||
private async getAvailableSubscriptions() {
|
||||
try {
|
||||
const subscriptions = await this.application.getAvailableSubscriptions();
|
||||
if (subscriptions) {
|
||||
if (!(subscriptions instanceof ClientDisplayableError)) {
|
||||
this.setAvailableSubscriptions(subscriptions);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -110,7 +111,7 @@ export class SubscriptionState {
|
||||
private async getSubscription() {
|
||||
try {
|
||||
const subscription = await this.application.getUserSubscription();
|
||||
if (subscription) {
|
||||
if (!(subscription instanceof ClientDisplayableError)) {
|
||||
this.setUserSubscription(subscription);
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user