Skip to content

Commit

Permalink
perf: add searching and finished ✅ emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng committed Mar 17, 2023
1 parent e889757 commit c0ab124
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/dataManager/dataManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { OpenAITranslateResult } from "./../types";
* @author: tisfeng
* @createTime: 2022-06-26 11:13
* @lastEditor: tisfeng
* @lastEditTime: 2023-03-17 09:54
* @lastEditTime: 2023-03-17 11:30
* @fileName: dataManager.ts
*
* Copyright (c) 2022 by tisfeng, All Rights Reserved.
*/

import { environment } from "@raycast/api";
import { Toast, environment, showToast } from "@raycast/api";
import axios from "axios";
import { getProxyAgent } from "../axiosConfig";
import { detectLanguage } from "../detectLanauge/detect";
Expand Down Expand Up @@ -778,6 +778,7 @@ export class DataManager {
openAIQueryResult.sourceResult.translations = [translatedText];
this.updateTranslationDisplay(openAIQueryResult);
}
this.removeQueryFromRecordList(type);
}
};

Expand All @@ -795,7 +796,7 @@ export class DataManager {
showErrorToast(error);
})
.finally(() => {
this.removeQueryFromRecordList(type);
// this.removeQueryFromRecordList(type);
});
}
}
Expand All @@ -821,6 +822,16 @@ export class DataManager {
if (!showingLoadingState) {
console.log("All queries finished.");
this.abortController = undefined;

showToast({
style: Toast.Style.Success,
title: `Finished ✅`,
});
} else {
showToast({
style: Toast.Style.Animated,
title: `Searching 🔍`,
});
}
}

Expand Down

0 comments on commit c0ab124

Please sign in to comment.