已关闭
StatusObserver 的 status 参数需要更新:将 restored 改为 restore #7
sfchu创建于 5 天前关闭于 3 天前
StatusObserver 的 status 参数需要更新:将 restored 改为 restore #7
已关闭
共 1 个文件变更+3-3
| @@ -58,11 +58,11 @@ export default class EntryAbility extends UIAbility { | |||
| 58 | let mailInfo: ContinuationData = new ContinuationData(undefined, undefined, undefined, undefined, undefined, | 58 | let mailInfo: ContinuationData = new ContinuationData(undefined, undefined, undefined, undefined, undefined, |
| 59 | undefined, undefined, undefined, undefined, undefined); | 59 | undefined, undefined, undefined, undefined, undefined); |
| 60 | this.distributedObject = distributedDataObject.create(this.context, mailInfo); | 60 | this.distributedObject = distributedDataObject.create(this.context, mailInfo); |
| 61 | - // Add a data restored listener. | 61 | + // Add a data restore listener. |
| 62 | try { | 62 | try { |
| 63 | this.distributedObject.on('status', | 63 | this.distributedObject.on('status', |
| 64 | - (_sessionId: string, _networkId: string, status: 'online' | 'offline' | 'restored') => { | 64 | + (_sessionId: string, _networkId: string, status: 'online' | 'offline') => { |
| 65 | - if (status === 'restored') { | 65 | + if (status !== 'online' && status !== 'offline') { |
| 66 | if (!this.distributedObject || !this.distributedFileUtil) { | 66 | if (!this.distributedObject || !this.distributedFileUtil) { |
| 67 | return; | 67 | return; |
| 68 | } | 68 | } |