1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-10 18:10:54 +09:00

update protocol

This commit is contained in:
Andrew Simachev 2024-02-12 12:08:22 +01:00
parent 3aa89609d9
commit ca453bbff6
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
3 changed files with 6 additions and 33 deletions

3
dist/.gitignore vendored
View file

@ -27,4 +27,5 @@ nmh.log
[0-9]*.js
[0-9]*.js.map
extension.crx
extension.pem
extension.pem
extension.zip

View file

@ -174,43 +174,14 @@ class PopupUsecasePageList extends React.Component<I.PopupUsecase, State> {
this.setState({ isLoading: true });
/*
C.GalleryDownloadIndex((message: any) => {
commonStore.gallery = {
categories: message.categories || [],
categories: (message.categories || []).map(it => ({ ...it, name: this.categoryName(it.id) })),
list: message.list || [],
};
this.setState({ isLoading: false });
});
*/
this.tmpLoad(() => {
this.setState({ isLoading: false });
}, () => {
this.setState({ isLoading: false });
});
};
tmpLoad (success: () => void, error: () => void): void {
$.ajax({
url: 'https://tools.gallery.any.coop/app-index.json',
dataType: 'json',
success: (data: any) => {
commonStore.gallery = {
categories: (data.categories || []).map(it => ({ ...it, name: this.categoryName(it.id) })),
list: (data.experiences || []).map(it => ({
...it,
size: it.fileSize,
})),
};
success();
},
error: () => {
error();
}
});
};
componentDidUpdate (): void {
@ -256,7 +227,7 @@ class PopupUsecasePageList extends React.Component<I.PopupUsecase, State> {
let items = commonStore.gallery.list || [];
if (category) {
items = items.filter(it => category.experiences.includes(it.name));
items = items.filter(it => category.list.includes(it.name));
};
if (filter) {

View file

@ -427,7 +427,8 @@ export const GalleryDownloadIndex = (response: Rpc.Gallery.DownloadIndex.Respons
return {
categories: (response.getCategoriesList() || []).map((it: Rpc.Gallery.DownloadIndex.Response.Category) => {
return {
name: it.getName(),
id: it.getId(),
icon: it.getIcon(),
list: it.getExperiencesList() || [],
};
}),