@@ -90,6 +90,8 @@ export const DEFAULT_FALLBACK_MAP_FILE_PATH = require.resolve(
90
90
export const DEFAULT_ONLINE_STYLE_URL =
91
91
'https://demotiles.maplibre.org/style.json'
92
92
93
+ export const DEFAULT_IS_ARCHIVE_DEVICE = true
94
+
93
95
/**
94
96
* @typedef {Omit<import('./local-peers.js').PeerInfo, 'protomux'> } PublicPeerInfo
95
97
*/
@@ -123,6 +125,7 @@ export class MapeoManager extends TypedEmitter {
123
125
#l
124
126
#defaultConfigPath
125
127
#makeWebsocket
128
+ #defaultIsArchiveDevice
126
129
127
130
/**
128
131
* @param {Object } opts
@@ -136,6 +139,7 @@ export class MapeoManager extends TypedEmitter {
136
139
* @param {string } [opts.customMapPath] File path to a locally stored Styled Map Package (SMP).
137
140
* @param {string } [opts.fallbackMapPath] File path to a locally stored Styled Map Package (SMP)
138
141
* @param {string } [opts.defaultOnlineStyleUrl] URL for an online-hosted StyleJSON asset.
142
+ * @param {boolean } [opts.defaultIsArchiveDevice] Whether the node is an archive device by default
139
143
* @param {(url: string) => WebSocket } [opts.makeWebsocket]
140
144
*/
141
145
constructor ( {
@@ -149,12 +153,14 @@ export class MapeoManager extends TypedEmitter {
149
153
customMapPath,
150
154
fallbackMapPath = DEFAULT_FALLBACK_MAP_FILE_PATH ,
151
155
defaultOnlineStyleUrl = DEFAULT_ONLINE_STYLE_URL ,
156
+ defaultIsArchiveDevice = DEFAULT_IS_ARCHIVE_DEVICE ,
152
157
makeWebsocket = ( url ) => new WebSocket ( url ) ,
153
158
} ) {
154
159
super ( )
155
160
this . #keyManager = new KeyManager ( rootKey )
156
161
this . #deviceId = getDeviceId ( this . #keyManager)
157
162
this . #defaultConfigPath = defaultConfigPath
163
+ this . #defaultIsArchiveDevice = defaultIsArchiveDevice
158
164
this . #makeWebsocket = makeWebsocket
159
165
const logger = ( this . #loggerBase = new Logger ( { deviceId : this . #deviceId } ) )
160
166
this . #l = Logger . create ( 'manager' , logger )
@@ -882,7 +888,7 @@ export class MapeoManager extends TypedEmitter {
882
888
if ( typeof row ?. isArchiveDevice === 'boolean' ) {
883
889
return row . isArchiveDevice
884
890
} else {
885
- return true
891
+ return this . #defaultIsArchiveDevice
886
892
}
887
893
}
888
894
0 commit comments