fix(ui/state_upDATER): clear file and info when not found
This commit is contained in:
parent
5c1d512a95
commit
591b50c51f
1 changed files with 10 additions and 1 deletions
|
@ -289,7 +289,13 @@ export class Updater {
|
|||
|
||||
gotoSearchResult = async (pathname: string): Promise<string> => {
|
||||
const metadataResp = await this.filesClient.metadata(pathname);
|
||||
if (metadataResp.status !== 200) {
|
||||
if (metadataResp.status === 404) {
|
||||
const deleteResp = await this.filesClient.delete(pathname);
|
||||
if (deleteResp.status !== 200) {
|
||||
return errServer;
|
||||
}
|
||||
return "term.noResult";
|
||||
} else if (metadataResp.status !== 200) {
|
||||
return errServer;
|
||||
}
|
||||
|
||||
|
@ -298,6 +304,9 @@ export class Updater {
|
|||
if (!metadataResp.data.isDir) {
|
||||
targetDir = targetDir.slice(0, parts.length - 1);
|
||||
}
|
||||
if (targetDir.join("/") === "") {
|
||||
targetDir = targetDir.push("/");
|
||||
}
|
||||
return updater().setItems(List(targetDir));
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue