Skip to content

Commit

Permalink
Remove console.log
Browse files Browse the repository at this point in the history
  • Loading branch information
artreimus committed Oct 22, 2022
1 parent eb25c20 commit 09aba3d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 35 deletions.
3 changes: 1 addition & 2 deletions src/components/google-drive/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function Dashboard() {
useProvideContext();

const [windowSize, setWindowSize] = useState(getWindowSize());
console.log(folderId);

useEffect(() => {
if (folderId === undefined) setCurrentPage('dashboard');
Expand Down Expand Up @@ -106,7 +105,7 @@ function Dashboard() {
<section className="section_files">
<div className="dashboard_container_header">
<h2 className="dashboard_header_title">Files</h2>
<AddFileButton currentFolder={folder} />
<AddFileButton />
<SortFilesMenu />
</div>
<hr className="dashboard_header_divider"></hr>
Expand Down
4 changes: 1 addition & 3 deletions src/components/google-drive/DeleteFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,18 @@ function DeleteFile({ fileId, fileName, userId, fileFolderId }: PropType) {
folder === ROOT_FOLDER
? `files/${userId}${folder.path.join('/')}/${fileName}`
: `files/${userId}/${folder.path.join('/')}/${folder.name}/${fileName}`;
console.log(filePath);

const storageRef = storage.ref();
const fileRef = storageRef.child(filePath);

fileRef
.delete()
.then(() => {
console.log('File deleted successfully in storage');
database.files
.doc(fileId)
.delete()
.then(() => {
console.log('Successfully deleted in database!');
console.log('Successfully deleted in database');
})
.catch(() => showError());
})
Expand Down
3 changes: 1 addition & 2 deletions src/components/google-drive/DeleteFolder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ function DeleteFolder({ folderId }: { folderId: string }) {
closeModal();

if (childFolders.length > 0 || childFiles.length > 0) {
console.log('not safe to delete');
showError();
return;
}
Expand Down Expand Up @@ -78,7 +77,7 @@ function DeleteFolder({ folderId }: { folderId: string }) {
>
<div className="button_container_icon">
<img src={require(`../../images/cancel.png`)} alt="File Icon" />
</div>{' '}
</div>
</button>
</div>
</Modal.Body>
Expand Down
16 changes: 4 additions & 12 deletions src/components/google-drive/FavoriteFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ import { database } from '../../firebase';

function FavoriteFile({ file }: any) {
function favoriteFile() {
database.files
.doc(file.id)
.update({
createdAt: database.getCurrentTimeStamps(),
isFavorite: !file.isFavorite,
})
.then(() => {
console.log('file favorite updated');
})
.catch(() => {
console.log('failed to change favorite');
});
database.files.doc(file.id).update({
createdAt: database.getCurrentTimeStamps(),
isFavorite: !file.isFavorite,
});
}

return (
Expand Down
16 changes: 4 additions & 12 deletions src/components/google-drive/FavoriteFolder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,10 @@ import { database } from '../../firebase';

function FavoriteFolder({ folder }: any) {
function favoriteFile() {
database.folders
.doc(folder.id)
.update({
createdAt: database.getCurrentTimeStamps(),
isFavorite: !folder.isFavorite,
})
.then(() => {
console.log('Folder favorite updated');
})
.catch(() => {
console.log('failed to change favorite of folder');
});
database.folders.doc(folder.id).update({
createdAt: database.getCurrentTimeStamps(),
isFavorite: !folder.isFavorite,
});
}

return (
Expand Down
4 changes: 0 additions & 4 deletions src/components/google-drive/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ function Sidebar({ windowWidth }: { windowWidth: number }) {
return { innerWidth, innerHeight };
}

console.log(windowSize.innerWidth);

const stylesSidebar = {
minWidth:
windowSize.innerWidth < 1300
Expand Down Expand Up @@ -55,8 +53,6 @@ function Sidebar({ windowWidth }: { windowWidth: number }) {
};

function setStylesFont(page: string) {
console.log(currentPage);
console.log(page === currentPage);
if (page === currentPage) {
return {
color: '#e8e8e8',
Expand Down

0 comments on commit 09aba3d

Please sign in to comment.