From 83ce367ace60743f84f67a3dc8b8c84a884b49ee Mon Sep 17 00:00:00 2001 From: sawka Date: Thu, 30 Mar 2023 00:59:05 -0700 Subject: [PATCH] set archived update for archived lines --- pkg/sstore/dbops.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/sstore/dbops.go b/pkg/sstore/dbops.go index dc8265337..f2637829d 100644 --- a/pkg/sstore/dbops.go +++ b/pkg/sstore/dbops.go @@ -1365,7 +1365,12 @@ func ArchiveScreenLines(ctx context.Context, screenId string) (*ModelUpdate, err if !tx.Exists(query, screenId) { return fmt.Errorf("screen does not exist") } - query = `UPDATE line SET archived = 1 WHERE screenid = ?` + if isWebShare(tx, screenId) { + query = `INSERT INTO screenupdate (screenid, lineid, updatetype, updatets) + SELECT screenid, lineid, ?, ? FROM line WHERE screenid = ? AND archived = 0` + tx.Exec(query, UpdateType_LineArchived, time.Now().UnixMilli(), screenId) + } + query = `UPDATE line SET archived = 1 WHERE screenid = ? AND archived = 0` tx.Exec(query, screenId) return nil })