移除陶泥儿发布回读后永远不会触发的 catch
- refreshOnline 内部吞掉所有失败、不 reject,原 catch 为死代码 - 去掉 try/catch,保留「换项目不改写」与「同项目改写后收起进度」语义
This commit is contained in:
+5
-7
@@ -300,14 +300,12 @@ export function useTaonierTab({
|
||||
step: 'submit',
|
||||
percent: null,
|
||||
});
|
||||
try {
|
||||
await taonier.refreshOnline();
|
||||
if (projectPathRef.current !== projectPath) return;
|
||||
// `refreshOnline` 自身吞掉所有失败(返回 `null` 并把状态置为 `unavailable`),不会 reject;这里只
|
||||
// 需要处理「回读期间换了项目」与「按发布响应改写草稿」,不再包一层永远走不到的 catch。
|
||||
await taonier.refreshOnline();
|
||||
if (projectPathRef.current === projectPath) {
|
||||
taonier.rewritePublishedMediaToObjectKeys(next);
|
||||
} catch {
|
||||
// 回读失败不影响本次发布结果:发布响应里已经带回 objectKey,下次打开会再回读一次。
|
||||
} finally {
|
||||
if (projectPathRef.current === projectPath) setProgress(null);
|
||||
setProgress(null);
|
||||
}
|
||||
} catch (error) {
|
||||
// 旧项目的发布失败不该记到新项目头上。
|
||||
|
||||
Reference in New Issue
Block a user