gpt4 book ai didi

javascript - 从 FunctionFile 中删除漫游设置时出现 Outlook 加载项问题

转载 作者:行者123 更新时间:2023-12-01 01:18:13 24 4
gpt4 key购买 nike

我在使用漫游设置和我一直在研究的加载项时遇到问题。

我们使用漫游设置来存储用户将对其进行 API 调用的 URL。加载项的 list 使用菜单控件,因此它提供了两个选项。一个加载加载项本身,另一个是一些用于清除漫游设置的 JavaScript。

Office.initialize = function (reason) {
}

function signOut(event) {
Office.context.roamingSettings.remove('domain_url');
Office.context.roamingSettings.saveAsync(() => {
event.completed();
});
}

我遇到的问题是,如果我加载加载项并使其保持打开状态,然后使用其他菜单项中的“删除漫游设置”选项,那么在我关闭该加载项之前,漫游设置似乎不会被删除。加载项并再次打开它。

加载的加载项仍然能够通过调用获取这些漫游设置:

return <T>Office.context.roamingSettings.get(name);

并且将继续能够,直到我关闭加载项。

有谁知道为什么即使漫游设置已被清除,这些 get 调用仍然提供结果,以及为什么只有在我关闭加载项并重新打开它之后,上面的 get 调用才不起作用?

最佳答案

以下是 MS 文档的引用:

Important: The RoamingSettings object is initialized from the persisted storage only when the add-in is first loaded. For task panes, this means that it is only initialized when the task pane first opens. If the task pane navigates to another page or reloads the current page, the in-memory object is reset to its initial values, even if your add-in has persisted changes. The persisted changes will not be available until the task pane is closed and reopened.

关于javascript - 从 FunctionFile 中删除漫游设置时出现 Outlook 加载项问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54514993/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com