mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-25 01:14:23 +01:00
chore: IDB_CONNECTION_READY action
This commit is contained in:
parent
87907eeb53
commit
ac7d5c04a3
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { IconCode, IconStack, IconGitPullRequest, IconUser, IconUsers, IconSettings, IconLayoutGrid } from '@tabler/icons';
|
import { IconCode, IconStack, IconGitPullRequest, IconUser, IconUsers, IconSettings, IconLayoutGrid, IconBuilding } from '@tabler/icons';
|
||||||
import StyledWrapper from './StyledWrapper';
|
import StyledWrapper from './StyledWrapper';
|
||||||
|
|
||||||
const MenuBar = () => {
|
const MenuBar = () => {
|
||||||
@ -23,6 +23,10 @@ const MenuBar = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col flex-grow justify-end">
|
<div className="flex flex-col flex-grow justify-end">
|
||||||
|
{/* Teams Icon */}
|
||||||
|
{/* <div className="menu-item">
|
||||||
|
<IconBuilding size={28} strokeWidth={1.5}/>
|
||||||
|
</div> */}
|
||||||
<div className="menu-item">
|
<div className="menu-item">
|
||||||
<IconUser size={28} strokeWidth={1.5}/>
|
<IconUser size={28} strokeWidth={1.5}/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import Mousetrap from 'mousetrap';
|
import Mousetrap from 'mousetrap';
|
||||||
|
|
||||||
export const HotkeysContext = React.createContext();
|
export const HotkeysContext = React.createContext();
|
||||||
@ -17,7 +17,7 @@ export const HotkeysProvider = props => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<HotkeysContext.Provider {...props}>
|
<HotkeysContext.Provider {...props} value='hotkey'>
|
||||||
{props.children}
|
{props.children}
|
||||||
</HotkeysContext.Provider>
|
</HotkeysContext.Provider>
|
||||||
);
|
);
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import React, { useEffect, useContext, useReducer, createContext } from 'react';
|
import React, { useEffect, useContext, useReducer, createContext } from 'react';
|
||||||
import reducer from './reducer';
|
import reducer from './reducer';
|
||||||
|
import useIdb from './useIdb';
|
||||||
import { sendRequest } from '../../network';
|
import { sendRequest } from '../../network';
|
||||||
import { nanoid } from 'nanoid';
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
export const StoreContext = createContext();
|
export const StoreContext = createContext();
|
||||||
|
|
||||||
const tabId1 = nanoid();
|
|
||||||
|
|
||||||
const collection = {
|
const collection = {
|
||||||
"id": nanoid(),
|
"id": nanoid(),
|
||||||
"name": "spacex",
|
"name": "spacex",
|
||||||
@ -112,6 +111,7 @@ const collection2 = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
|
idbConnection: null,
|
||||||
collections: [collection, collection2],
|
collections: [collection, collection2],
|
||||||
activeRequestTabId: null,
|
activeRequestTabId: null,
|
||||||
requestQueuedToSend: null,
|
requestQueuedToSend: null,
|
||||||
@ -132,6 +132,8 @@ export const StoreProvider = props => {
|
|||||||
}
|
}
|
||||||
}, [state.requestQueuedToSend]);
|
}, [state.requestQueuedToSend]);
|
||||||
|
|
||||||
|
useIdb(dispatch);
|
||||||
|
|
||||||
return <StoreContext.Provider value={[state, dispatch]} {...props} />;
|
return <StoreContext.Provider value={[state, dispatch]} {...props} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -15,6 +15,14 @@ import {
|
|||||||
|
|
||||||
const reducer = (state, action) => {
|
const reducer = (state, action) => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
case actions.IDB_CONNECTION_READY: {
|
||||||
|
return produce(state, (draft) => {
|
||||||
|
draft.idbConnection = action.connection;
|
||||||
|
|
||||||
|
console.log("here");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
case actions.SIDEBAR_COLLECTION_CLICK: {
|
case actions.SIDEBAR_COLLECTION_CLICK: {
|
||||||
return produce(state, (draft) => {
|
return produce(state, (draft) => {
|
||||||
const collection = find(draft.collections, (c) => c.id === action.id);
|
const collection = find(draft.collections, (c) => c.id === action.id);
|
||||||
|
Loading…
Reference in New Issue
Block a user