@autobusal/providers 1.44.3 → 1.44.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Setup/Preload.tsx +30 -4
- package/package.json +1 -1
- package/types/orders.ts +15 -0
package/Setup/Preload.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import { JsonLd, setServerToday } from '@autobusal/common';
|
|
2
|
+
import { JsonLd, hasMetaMounted, setServerToday } from '@autobusal/common';
|
|
3
3
|
import { SettingsData } from '../types/settings';
|
|
4
4
|
import { useSystemTheme } from '@autobusal/hooks';
|
|
5
5
|
|
|
@@ -76,11 +76,37 @@ const Preload = ({ data, children }: Props): JSX.Element => {
|
|
|
76
76
|
// sold them quite happily.
|
|
77
77
|
setServerToday(data.today);
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
/*
|
|
80
|
+
* The app-shell title, for the moment before a page's own <Meta> mounts -
|
|
81
|
+
* AND MARKED, so that page can take it away again.
|
|
82
|
+
*
|
|
83
|
+
* Edited: Claude - Date: 2026-09-16
|
|
84
|
+
*
|
|
85
|
+
* Assigning document.title when <head> holds no <title> does not just set a
|
|
86
|
+
* string: the browser CREATES a <title> element for it. On a route whose
|
|
87
|
+
* chunk is still loading there is nothing else in there - main.tsx has
|
|
88
|
+
* already stripped index.html's build-time tag - so this fallback made one,
|
|
89
|
+
* and when the page's own <Meta> arrived React hoisted a second beside it.
|
|
90
|
+
* Both were then captured into the prerendered snapshot, which is why Bing's
|
|
91
|
+
* site scan reported "More than one title tag" on 112 pages. A browser reads
|
|
92
|
+
* the first, which is the right one, so nothing looked wrong; a crawler
|
|
93
|
+
* reading the HTML sees two, and the stray one says only the brand name.
|
|
94
|
+
*
|
|
95
|
+
* Meta removes any element carrying this marker as soon as it owns the head
|
|
96
|
+
* (see useSoleMetaOwnership in @autobusal/common), so the fallback lasts
|
|
97
|
+
* exactly as long as it is the only title there is.
|
|
98
|
+
*/
|
|
80
99
|
useEffect(() => {
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
// Nothing to stand in for: the page owns the title, or already put one
|
|
101
|
+
// up. hasMetaMounted is the half of this that a marker cannot cover -
|
|
102
|
+
// see the note on it in @autobusal/common's Meta.
|
|
103
|
+
if (hasMetaMounted() || document.head.querySelector('title')) {
|
|
104
|
+
return;
|
|
83
105
|
}
|
|
106
|
+
|
|
107
|
+
document.title = data.preferences.company;
|
|
108
|
+
|
|
109
|
+
document.head.querySelector('title')?.setAttribute('data-shell-title', '');
|
|
84
110
|
}, [ data.preferences.company ]);
|
|
85
111
|
|
|
86
112
|
// we arrange the font family names before inserting them
|
package/package.json
CHANGED
package/types/orders.ts
CHANGED
|
@@ -75,6 +75,21 @@ export interface OrderData {
|
|
|
75
75
|
payment?: {
|
|
76
76
|
method: string | null
|
|
77
77
|
label: string | null
|
|
78
|
+
// Claude - 2026-09-24: the card gateway by name ("Raiffeisen") - the
|
|
79
|
+
// single-order endpoint sends it; the listing maps it client-side
|
|
80
|
+
provider?: string | null
|
|
81
|
+
}
|
|
82
|
+
/*
|
|
83
|
+
* Claude - 2026-09-24: ADMIN ONLY - what sits around the fare on this
|
|
84
|
+
* order, formatted by obtapi (Libraries\Orders\View). `total` is what the
|
|
85
|
+
* buyer's card was charged; the gateway fee is withheld from the brand
|
|
86
|
+
* and is not part of it. A null field has nothing to show.
|
|
87
|
+
*/
|
|
88
|
+
charges?: {
|
|
89
|
+
extras: string | null
|
|
90
|
+
surcharge: string | null
|
|
91
|
+
total: string | null
|
|
92
|
+
gateway_fee: string | null
|
|
78
93
|
}
|
|
79
94
|
seller?: {
|
|
80
95
|
name: string
|