diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 12:07:41 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-15 12:07:41 -0600 |
commit | 4ae6fbd3c8e8be9d47d0bd959aeac380f7bf67ce (patch) | |
tree | 89648c8a9a91ef0f67e49dfa4c5e0a449c7461f4 /src/state/models | |
parent | e470e3933b923abfeed4eb8c3bd0cf0b32b0232d (diff) | |
download | voidsky-4ae6fbd3c8e8be9d47d0bd959aeac380f7bf67ce.tar.zst |
Better loading screens
Diffstat (limited to 'src/state/models')
-rw-r--r-- | src/state/models/post.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/state/models/post.ts b/src/state/models/post.ts index 7ecd62287..767182a93 100644 --- a/src/state/models/post.ts +++ b/src/state/models/post.ts @@ -2,6 +2,7 @@ import {makeAutoObservable} from 'mobx' import * as Post from '../../third-party/api/src/client/types/app/bsky/feed/post' import {AtUri} from '../../third-party/uri' import {RootStoreModel} from './root-store' +import {cleanError} from '../../view/lib/strings' export type PostEntities = Post.Record['entities'] export type PostReply = Post.Record['reply'] @@ -67,7 +68,7 @@ export class PostModel implements RemoveIndex<Post.Record> { private _xIdle(err: string = '') { this.isLoading = false this.hasLoaded = true - this.error = err + this.error = cleanError(err) } // loader functions @@ -88,7 +89,7 @@ export class PostModel implements RemoveIndex<Post.Record> { this._replaceAll(res.value) this._xIdle() } catch (e: any) { - this._xIdle(`Failed to load post: ${e.toString()}`) + this._xIdle(e.toString()) } } |