From 0b13a9705d88d2ed17ded6b00f74a95228d04aa7 Mon Sep 17 00:00:00 2001 From: David Dworken Date: Sun, 30 Apr 2023 08:50:17 -0700 Subject: [PATCH] Fix control-K in offline mode for #80 --- client/client_test.go | 2 ++ client/lib/tui.go | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/client/client_test.go b/client/client_test.go index 4e53bf4..363a0dd 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -1790,6 +1790,8 @@ func TestFish(t *testing.T) { testutils.CompareGoldens(t, out, "TestFish-table") } +// TODO(ddworken): Run TestTui in online and offline mode + func TestTui(t *testing.T) { // Setup defer testutils.BackupAndRestore(t)() diff --git a/client/lib/tui.go b/client/lib/tui.go index 1479c5c..2f43aa7 100644 --- a/client/lib/tui.go +++ b/client/lib/tui.go @@ -496,7 +496,12 @@ func deleteHistoryEntry(ctx *context.Context, entry data.HistoryEntry) error { if r.Error != nil { return r.Error } + // Delete remotely + config := hctx.GetConf(ctx) + if config.IsOffline { + return nil + } dr := shared.DeletionRequest{ UserId: data.UserId(hctx.GetConf(ctx).UserSecret), SendTime: time.Now(),