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:
parent
3aa89609d9
commit
ca453bbff6
3 changed files with 6 additions and 33 deletions
3
dist/.gitignore
vendored
3
dist/.gitignore
vendored
|
@ -27,4 +27,5 @@ nmh.log
|
|||
[0-9]*.js
|
||||
[0-9]*.js.map
|
||||
extension.crx
|
||||
extension.pem
|
||||
extension.pem
|
||||
extension.zip
|
|
@ -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) {
|
||||
|
|
|
@ -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() || [],
|
||||
};
|
||||
}),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue