Removed old experiments settings and staff mode flag, added new StaffMode global that is set based on the webserver's staff bit

This commit is contained in:
Mikayla Maki 2023-01-23 14:31:10 -08:00
parent ca2e0256e1
commit ea39983f78
40 changed files with 66 additions and 124 deletions

View file

@ -550,7 +550,6 @@ impl Project {
if !cx.read(|cx| cx.has_global::<Settings>()) {
cx.update(|cx| {
cx.set_global(Settings::test(cx));
cx.set_global(HomeDir(Path::new("/tmp/").to_path_buf()))
});
}

View file

@ -5,8 +5,8 @@ use anyhow::{anyhow, Context, Result};
use client::{proto, Client};
use clock::ReplicaId;
use collections::{HashMap, VecDeque};
use fs::LineEnding;
use fs::{repository::GitRepository, Fs};
use fs::{HomeDir, LineEnding};
use futures::{
channel::{
mpsc::{self, UnboundedSender},
@ -49,6 +49,7 @@ use std::{
time::{Duration, SystemTime},
};
use sum_tree::{Bias, Edit, SeekTarget, SumTree, TreeMap, TreeSet};
use util::paths::HOME;
use util::{ResultExt, TryFutureExt};
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash, PartialOrd, Ord)]
@ -1831,9 +1832,9 @@ impl language::File for File {
} else {
let path = worktree.abs_path();
if worktree.is_local() && path.starts_with(cx.global::<HomeDir>().as_path()) {
if worktree.is_local() && path.starts_with(HOME.as_path()) {
full_path.push("~");
full_path.push(path.strip_prefix(cx.global::<HomeDir>().as_path()).unwrap());
full_path.push(path.strip_prefix(HOME.as_path()).unwrap());
} else {
full_path.push(path)
}