Skip to content

Commit

Permalink
chore: remove css and ts for isnew and modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyrxng committed Mar 5, 2024
1 parent 7093c96 commit aec6f8a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 58 deletions.
7 changes: 2 additions & 5 deletions src/home/fetch-github/fetch-and-display-previews.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export async function fetchAndDisplayPreviewsFromCache(sorting?: Sorting, option
};
}

const cachedTasks = _cachedTasks.tasks.map((task) => ({ ...task, isNew: false, isModified: false })) as TaskMaybeFull[];
const cachedTasks = _cachedTasks.tasks as TaskMaybeFull[];
taskManager.syncTasks(cachedTasks);

if (!cachedTasks.length) {
Expand Down Expand Up @@ -73,8 +73,7 @@ export function verifyGitHubIssueState(cachedTasks: TaskMaybeFull[], fetchedPrev
if (cachedTask) {
if (taskWithFullTest(cachedTask)) {
const cachedFullIssue = cachedTask.full;
const isModified = new Date(cachedFullIssue.updated_at) < new Date(fetched.preview.updated_at);
const task = { ...fetched, full: cachedFullIssue, isModified };
const task = { ...fetched, full: cachedFullIssue };
return task;
} else {
// no full issue in task
Expand All @@ -84,8 +83,6 @@ export function verifyGitHubIssueState(cachedTasks: TaskMaybeFull[], fetchedPrev
}
return {
preview: fetched.preview,
isNew: true,
isModified: false,
} as TaskNoFull;
});
}
Expand Down
13 changes: 1 addition & 12 deletions src/home/getters/get-local-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,5 @@ export function getLocalStore(key: string): TaskStorageItems | OAuthToken | null

export function setLocalStore(key: string, value: TaskStorageItems | OAuthToken) {
// remove state from issues before saving to local storage
if ("tasks" in value && value.tasks.length && "isNew" in value.tasks[0] && "isModified" in value.tasks[0]) {
const tasksWithoutState = value.tasks.map(({ preview, full }) => ({
preview,
full,
}));
localStorage[key] = JSON.stringify({
...value,
tasks: tasksWithoutState,
});
} else {
localStorage[key] = JSON.stringify(value);
}
localStorage[key] = JSON.stringify(value);
}
7 changes: 0 additions & 7 deletions src/home/rendering/render-github-issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ function everyNewIssue({ taskPreview, container }: { taskPreview: TaskMaybeFull;
issueElement.setAttribute("data-preview-id", taskPreview.preview.id.toString());
issueElement.classList.add("issue-element-inner");

if (taskPreview.isNew) {
issueWrapper.classList.add("new-task");
}
if (taskPreview.isModified) {
issueWrapper.classList.add("modified-task");
}

const urlPattern = /https:\/\/github\.com\/([^/]+)\/([^/]+)\//;
const match = taskPreview.preview.body.match(urlPattern);
const organizationName = match?.[1];
Expand Down
17 changes: 0 additions & 17 deletions static/style/inverted-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,6 @@
.full {
display: unset !important;
}
.new-task,
.modified-task {
position: relative;
}
.new-task::before,
.modified-task::before {
content: "";
display: inline-block;
position: absolute;
height: 100%;
width: 4px;
left: 0;
background-color: #00ffff;
}
.modified-task::before {
background-color: #ffff00;
}
@media screen and (max-width: 804px) {
.mid {
display: none !important;
Expand Down
17 changes: 0 additions & 17 deletions static/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -321,23 +321,6 @@
.full {
display: unset !important;
}
.new-task,
.modified-task {
position: relative;
}
.new-task::before,
.modified-task::before {
content: "";
display: inline-block;
position: absolute;
height: 100%;
width: 4px;
left: 0;
background-color: #0ff;
}
.modified-task::before {
background-color: #ff0;
}
@media screen and (max-width: 804px) {
.mid {
display: none !important;
Expand Down

0 comments on commit aec6f8a

Please sign in to comment.