Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up some unused stuff in logs #970

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions src/stores/JournalData/Logs/Store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const getInitialStateData = (): Pick<
| 'noData'
| 'olderFinished'
| 'refresh'
| 'scrollOnLoad'
| 'scrollToWhenDone'
| 'tailNewLogs'
> => ({
Expand All @@ -63,7 +62,6 @@ const getInitialStateData = (): Pick<
fetchingOlder: false,
noData: false,
olderFinished: false,
scrollOnLoad: true,
refresh: null,
tailNewLogs: false,
});
Expand Down Expand Up @@ -135,6 +133,7 @@ const getInitialState = (
},

addNewDocuments: (docs, olderFinished, lastParsed) => {
console.log('addNewDocuments');
set(
produce((state: JournalDataLogsState) => {
if (!docs) {
Expand Down Expand Up @@ -267,16 +266,6 @@ const getInitialState = (
);
},

setScrollOnLoad: (newState) => {
set(
produce((state: JournalDataLogsState) => {
state.scrollOnLoad = newState;
}),
false,
'JournalsData:Logs: Scroll On Load Set'
);
},

resetState: () => {
set(
{ ...getInitialStateData(), ...getInitialHydrationData() },
Expand Down
14 changes: 0 additions & 14 deletions src/stores/JournalData/Logs/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ export const useJournalDataLogsStore_hydrated = () => {
>(JournalDataStoreNames.LOGS, (state) => state.hydrated);
};

export const useJournalDataLogsStore_refresh = () => {
return useZustandStore<
JournalDataLogsState,
JournalDataLogsState['refresh']
>(JournalDataStoreNames.LOGS, (state) => state.refresh);
};

export const useJournalDataLogsStore_documents = () => {
return useZustandStore<
JournalDataLogsState,
Expand Down Expand Up @@ -72,13 +65,6 @@ export const useJournalDataLogsStore_resetState = () => {
>(JournalDataStoreNames.LOGS, (state) => state.resetState);
};

export const useJournalDataLogsStore_allowFetchingMore = () => {
return useZustandStore<
JournalDataLogsState,
JournalDataLogsState['allowFetchingMore']
>(JournalDataStoreNames.LOGS, (state) => state.allowFetchingMore);
};

export const useJournalDataLogsStore_setAllowFetchingMore = () => {
return useZustandStore<
JournalDataLogsState,
Expand Down
3 changes: 0 additions & 3 deletions src/stores/JournalData/Logs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ export interface JournalDataLogsState extends StoreWithHydration {
olderFinished: boolean;
setOlderFinished: (val: JournalDataLogsState['olderFinished']) => void;

scrollOnLoad: boolean;
setScrollOnLoad: (val: JournalDataLogsState['scrollOnLoad']) => void;

tailNewLogs: boolean;
setTailNewLogs: (val: JournalDataLogsState['tailNewLogs']) => void;

Expand Down