我在 c# winforms 中为我的应用程序使用 Firesharp。这个数据库也连接到我的 ReactJS 网站,它处理相同的信息。
我注意到,当我.SetAsync在网站上调用我的应用程序然后登录到我的 Winforms 应用程序时,我的 WinForms 应用程序将自动执行我在网站上执行的最后一个操作到我的数据库,这是一个.setAsync()将一些用户信息添加到其他用户信息的列表。现在它不会停止。每当我登录到我的 c# 应用程序时,它都会运行它。
这让我觉得firesharp中有一个订单队列?
这是我的反应代码。据我所知,这并没有什么特别之处:
async function handleSubmit(e) {
e.preventDefault()
var date = moment().format("MM/DD/YYYY" )
setError("")
setLoading(true)
// grab user info first then use that.
await firebaseApp.database().ref("Users/" + currentUser.uid + "/UserData").on('value', snapshot => {
if (snapshot.val() != null) {
setContactObjects({
...snapshot.val()
})
firebaseApp.database().ref("Projects/" + projectGUIDRef.current.value + "/queueList/" + userIdRef.current.value).set({
"EntryTimeStamp": date + " " + moment().format("hh:mm:ss a"),
"IsSyncing": false,
"UserId": userIdRef.current.value,
"UserName": usernameRef.current.value,
})
}
})
history.push("/Demo")
setLoading(false)
}
这是我的代码执行位置的 c# winforms 代码。由于某种原因,当它执行时,它也会更新EntryTimeStamp反应代码的字段并完全设置所有信息,即使我删除它也是如此。如果我跑步也会发生这种情况.set()。
updateLastLogin2(authLink);
private async void updateLastLogin2(FirebaseAuthLink authLink)
{
IFirebaseConfig config = new FireSharp.Config.FirebaseConfig
{
AuthSecret = this.authLink.FirebaseToken,
BasePath = Command.dbURL,
};
IFirebaseClient client = new FireSharp.FirebaseClient(config);
string newDateTime = DateTime.Now.ToString();
if (authLink.User.DisplayName.Contains(adUserId) && authLink.User.DisplayName.Contains(adUserId))
{
await client.SetAsync("Users/" + this.authLink.User.LocalId + "/UserData/DateLastLogin", newDateTime);
}
}
感谢任何和所有的帮助,我已经在这里待了一天半了。