Skip to content

Commit 59911ce

Browse files
committed
Fix issue when pinning a record unexist in the database
1 parent a82e2a2 commit 59911ce

File tree

1 file changed

+8
-1
lines changed
  • src/Flow.Launcher.Plugin.ClipboardPlus

1 file changed

+8
-1
lines changed

src/Flow.Launcher.Plugin.ClipboardPlus/Main.cs

+8-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,14 @@ private void PinOneRecord(ClipboardDataPair clipboardDataPair, bool requery)
899899
{
900900
ReQuery();
901901
}
902-
_ = Database.PinOneRecordAsync(clipboardDataPair.ClipboardData);
902+
if (!clipboardDataPair.ClipboardData.Saved)
903+
{
904+
_ = Database.AddOneRecordAsync(clipboardDataPair.ClipboardData, true);
905+
}
906+
else
907+
{
908+
_ = Database.PinOneRecordAsync(clipboardDataPair.ClipboardData);
909+
}
903910
}
904911

905912
private async void ReQuery()

0 commit comments

Comments
 (0)