Rename application ID

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak 2023-10-17 23:09:24 +02:00
parent 8fff46e0e3
commit 68292e72b7
5 changed files with 15 additions and 4 deletions

View file

@ -11,7 +11,7 @@
<%- snippets %>
</head>
<body class="theme-mode-light no-reduce-motion">
<div id="soapbox" class="h-full">
<div id="bigbuffet" class="h-full">
<div class="loading-indicator-wrapper">
<div class="loading-indicator">
<div class="loading-indicator__container">

View file

@ -22,7 +22,7 @@ const Portal: React.FC<IPortal> = ({ children }) => {
return (
ReactDOM.createPortal(
children,
document.getElementById('soapbox') as HTMLDivElement,
document.getElementById('bigbuffet') as HTMLDivElement,
)
);
};

View file

@ -50,7 +50,7 @@ const TestApp: FC<any> = ({ children, storeProps, routerProps = {} }) => {
};
return (
<div id='soapbox'>
<div id='bigbuffet'>
<Provider store={props.store}>
<MemoryRouter {...routerProps}>
<StatProvider>

View file

@ -33,7 +33,7 @@ if (BuildConfig.NODE_ENV === 'production') {
}
ready(() => {
const container = document.getElementById('soapbox') as HTMLElement;
const container = document.getElementById('bigbuffet') as HTMLElement;
const root = createRoot(container);
root.render(<Soapbox />);

View file

@ -132,6 +132,16 @@ const fixTakahe = (instance: ImmutableMap<string, any>) => {
}
};
const fixBigBuffet = (instance: ImmutableMap<string, any>) => {
const version: string = instance.get('version', '');
if (version.includes('+bigbuffet')) {
return instance.set('version', version.replace('+bigbuffet', '+soapbox'));
} else {
return instance;
}
};
// Normalize instance (Pleroma, Mastodon, etc.) to Mastodon's format
export const normalizeInstance = (instance: Record<string, any>) => {
return InstanceRecord(
@ -156,6 +166,7 @@ export const normalizeInstance = (instance: Record<string, any>) => {
normalizeVersion(instance);
fixTakahe(instance);
fixAkkoma(instance);
fixBigBuffet(instance);
// Merge defaults
instance.mergeDeepWith(mergeDefined, InstanceRecord());