Skip to content

Commit c1a4b81

Browse files
committed
Revert "add a value in statue db"
This reverts commit 5c3ef7b.
1 parent 5c3ef7b commit c1a4b81

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,6 @@ impl ChatSession {
11791179
}
11801180

11811181
async fn show_changelog_announcement(&mut self, os: &mut Os) -> Result<()> {
1182-
let has_used_before = os.database.has_used_chat_before()?;
1183-
if !has_used_before {
1184-
os.database.mark_chat_as_used()?;
1185-
return Ok(());
1186-
}
1187-
11881182
let current_version = env!("CARGO_PKG_VERSION");
11891183
let last_version = os.database.get_changelog_last_version()?;
11901184
let show_count = os.database.get_changelog_show_count()?.unwrap_or(0);

crates/chat-cli/src/database/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const IDC_REGION_KEY: &str = "auth.idc.region";
6363
const CUSTOMIZATION_STATE_KEY: &str = "api.selectedCustomization";
6464
const PROFILE_MIGRATION_KEY: &str = "profile.Migrated";
6565
const HEARTBEAT_DATE_KEY: &str = "telemetry.lastHeartbeatDate";
66-
const CHAT_USED_BEFORE_KEY: &str = "chat.usedBefore";
6766

6867
const MIGRATIONS: &[Migration] = migrations![
6968
"000_migration_table",
@@ -508,20 +507,6 @@ impl Database {
508507

509508
Ok(map)
510509
}
511-
512-
/// Check if chat has been used before
513-
/// Returns true if user has used chat before, false if this is the first time
514-
pub fn has_used_chat_before(&self) -> Result<bool, DatabaseError> {
515-
Ok(self
516-
.get_entry::<bool>(Table::State, CHAT_USED_BEFORE_KEY)?
517-
.unwrap_or(false))
518-
}
519-
520-
/// Mark that chat has been used
521-
pub fn mark_chat_as_used(&self) -> Result<(), DatabaseError> {
522-
self.set_entry(Table::State, CHAT_USED_BEFORE_KEY, true)?;
523-
Ok(())
524-
}
525510
}
526511

527512
fn max_migration_version<C: Deref<Target = Connection>>(conn: &C) -> Option<i64> {

0 commit comments

Comments
 (0)