remove # char if user inserted it
Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
@@ -776,7 +776,8 @@ pub fn hashtag_ui(
|
|||||||
.add_sized(egui::vec2(50.0, 40.0), add_column_button())
|
.add_sized(egui::vec2(50.0, 40.0), add_column_button())
|
||||||
.clicked()
|
.clicked()
|
||||||
{
|
{
|
||||||
let resp = AddColumnOption::Hashtag(text_buffer.to_owned()).take_as_response(ndb, None);
|
let resp =
|
||||||
|
AddColumnOption::Hashtag(sanitize_hashtag(text_buffer)).take_as_response(ndb, None);
|
||||||
id_string_map.remove(&id);
|
id_string_map.remove(&id);
|
||||||
resp
|
resp
|
||||||
} else {
|
} else {
|
||||||
@@ -786,6 +787,10 @@ pub fn hashtag_ui(
|
|||||||
.inner
|
.inner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn sanitize_hashtag(raw_hashtag: &str) -> String {
|
||||||
|
raw_hashtag.replace("#", "")
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user