fix: server/client parity

This commit is contained in:
cha0s 2022-03-18 14:19:03 -05:00
parent 7aa648fc9d
commit 4fbbbbeac4
5 changed files with 8 additions and 20 deletions

View File

@ -17,8 +17,6 @@
"files": [ "files": [
"assets", "assets",
"build", "build",
"client.js",
"client.js.map",
"index.css", "index.css",
"index.css.map", "index.css.map",
"index.js", "index.js",

View File

@ -1,9 +0,0 @@
import {Hooks} from '@flecks/core';
import Persea from './components/persea';
export default {
[Hooks]: {
'@flecks/react.roots': () => Persea,
},
};

View File

@ -20,6 +20,10 @@ import {
import OrganizationActions from './actions'; import OrganizationActions from './actions';
import './index.scss'; import './index.scss';
const normalizeDisplayName = (displayName) => (
displayName.startsWith('HotExported') ? displayName.slice(11) : displayName
);
const Organization = ({ const Organization = ({
className, className,
label, label,
@ -29,11 +33,7 @@ const Organization = ({
const dispatch = useDispatch(); const dispatch = useDispatch();
const flecks = useFlecks(); const flecks = useFlecks();
const location = useLocation(); const location = useLocation();
const [collapsed, __setCollapsed] = useState(JSON.parse(window.localStorage['@persea/core/explorer'] || '{}')); const [collapsed, setCollapsed] = useState({});
const setCollapsed = (next) => {
window.localStorage['@persea/core/explorer'] = JSON.stringify(next);
__setCollapsed(next);
};
const treeFromResourcePath = (tree, uuid, [isFile, resourcePath]) => { const treeFromResourcePath = (tree, uuid, [isFile, resourcePath]) => {
const parts = resourcePath.split('/'); const parts = resourcePath.split('/');
parts.shift(); parts.shift();
@ -100,7 +100,7 @@ const Organization = ({
.Component; .Component;
return ( return (
<div className="label inline"> <div className="label inline">
{!nodes && <div className={`icon ${displayName}`} />} {!nodes && <div className={`icon ${normalizeDisplayName(displayName)}`} />}
<span className="text">{label}</span> <span className="text">{label}</span>
{value === uuid && ( {value === uuid && (
<OrganizationActions <OrganizationActions

View File

@ -1,12 +1,14 @@
import {patchJsonResource} from '@avocado/resource-persea'; import {patchJsonResource} from '@avocado/resource-persea';
import {Hooks} from '@flecks/core'; import {Hooks} from '@flecks/core';
import Persea from './components/persea';
import {projects} from './state'; import {projects} from './state';
export * from './state'; export * from './state';
export default { export default {
[Hooks]: { [Hooks]: {
'@flecks/react.roots': () => Persea,
'@flecks/redux.effects': (flecks) => { '@flecks/redux.effects': (flecks) => {
const withSocket = (fn) => (...args) => fn(...args.concat(flecks.get('$flecks/socket.socket'))); const withSocket = (fn) => (...args) => fn(...args.concat(flecks.get('$flecks/socket.socket')));
return { return {

View File

@ -22,9 +22,6 @@ export default {
resources(req, res, next); resources(req, res, next);
return; return;
} }
if (req.url.startsWith('/project')) {
req.url = '/';
}
next(); next();
}, },
'@flecks/socket.packets.decorate': ( '@flecks/socket.packets.decorate': (