EventIndex: Add some more docs and fix some lint issues.
parent
c26df9d9ef
commit
cc2ee53824
|
@ -153,6 +153,12 @@ export default class BasePlatform {
|
||||||
throw new Error("Unimplemented");
|
throw new Error("Unimplemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get our platform specific EventIndexManager.
|
||||||
|
*
|
||||||
|
* @return {BaseEventIndexManager} The EventIndex manager for our platform,
|
||||||
|
* can be null if the platform doesn't support event indexing.
|
||||||
|
*/
|
||||||
getEventIndexingManager(): BaseEventIndexManager | null {
|
getEventIndexingManager(): BaseEventIndexManager | null {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,16 +34,16 @@ class EventIndexPeg {
|
||||||
/**
|
/**
|
||||||
* Get the current event index.
|
* Get the current event index.
|
||||||
*
|
*
|
||||||
* @Returns The EventIndex object for the application. Can be null
|
* @return {EventIndex} The current event index.
|
||||||
* if the platform doesn't support event indexing.
|
|
||||||
*/
|
*/
|
||||||
get() {
|
get() {
|
||||||
return this.index;
|
return this.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Create a new EventIndex and initialize it if the platform supports it.
|
/** Create a new EventIndex and initialize it if the platform supports it.
|
||||||
* Returns true if an EventIndex was successfully initialized, false
|
*
|
||||||
* otherwise.
|
* @return {Promise<bool>} A promise that will resolve to true if an
|
||||||
|
* EventIndex was successfully initialized, false otherwise.
|
||||||
*/
|
*/
|
||||||
async init() {
|
async init() {
|
||||||
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
const indexManager = PlatformPeg.get().getEventIndexingManager();
|
||||||
|
@ -71,15 +71,27 @@ class EventIndexPeg {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Stop our event indexer.
|
||||||
|
*/
|
||||||
stop() {
|
stop() {
|
||||||
if (this.index === null) return;
|
if (this.index === null) return;
|
||||||
this.index.stop();
|
this.index.stop();
|
||||||
this.index = null;
|
this.index = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete our event indexer.
|
||||||
|
*
|
||||||
|
* After a call to this the init() method will need to be called again.
|
||||||
|
*
|
||||||
|
* @return {Promise} A promise that will resolve once the event index is
|
||||||
|
* deleted.
|
||||||
|
*/
|
||||||
async deleteEventIndex() {
|
async deleteEventIndex() {
|
||||||
if (this.index === null) return;
|
if (this.index === null) return;
|
||||||
this.index.deleteEventIndex();
|
this.index.deleteEventIndex();
|
||||||
|
this.index = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ module.exports = createReactClass({
|
||||||
this.searchId = new Date().getTime();
|
this.searchId = new Date().getTime();
|
||||||
|
|
||||||
let roomId;
|
let roomId;
|
||||||
if (scope === "Room") roomId = this.state.room.roomId,
|
if (scope === "Room") roomId = this.state.room.roomId;
|
||||||
|
|
||||||
debuglog("sending search request");
|
debuglog("sending search request");
|
||||||
const searchPromise = eventSearch(term, roomId);
|
const searchPromise = eventSearch(term, roomId);
|
||||||
|
|
Loading…
Reference in New Issue